I'm working on an app that requires creating objects with a startDate displayed in 3 different timezones within the browser, including the exact time. I need to store the date in a way that allows for queries like "give me all dates between X and Y" while also being able to parse it into those 3 timezones.
My main question is what's the best way to save and retrieve the date and time later for querying? Should I consider using moment.js? One idea I had was storing both the date and time as a single Unix timestamp in the database, then parsing it into the specific date and time with the relevant timezone when reading. Is this a good approach, or should I stick to saving it as a plain JavaScript Date object? Can MongoDB query Unix timestamps as date ranges, or does it require plain Date objects?
Any insights would be much appreciated!