How do i search and query based on time?

for context i am using the mongodb golang driver GitHub - mongodb/mongo-go-driver: The Official Golang driver for MongoDB incase that changes anything

If you need clarifications on anything i can add details

Thanks in advance