Suppose a user of your website select days times and account timezone:
2015-09-02 14:15:00
2015-09-02 15:30:00
2015-09-03 17:10:00
Timezone: "America/Los_Angeles"
You send and keep this information at the server and the server should execute A function at the exact same local time the user needs it. At later time the user can change his timezone to "Europe/Stockholm"
and we re-adjust the dates by this timezone.
How should the flow from client to server should look like? What are my actions? There is a lot of wrong and misinformation over the internet I really need some solid advice.
Here is what I came up with:
I save this javascript object to the database
moment.tz("2015-09-02 14:15:00", "America/Los_Angeles").toDate()
and based on this date I execute the function and if we need to recalculate the timezone we just take days/times and use the same thing.
I have read that this way might not be adjusted to day light saving time and it's wrong. Help?