Timezone Question

I have an app with a bulletin wall where people post stuff, and i give the option for users to select a date/time (Time Picker) for the post to show up on the wall, which is being saved as a “post date”, and on the wall the Repeating Group i put a constraint to show only posts that has its “post date” past current date/time.

What if a user lives in say Italy - which is 6 hours ahead of NY - and selects say Oct 12 9:00am, will his post show up Oct 12 9:00am Italy Time? in other words, a user in NY will see it show up 3:00am NY Time?

I guess the question also entails: “Current Date/Time” constraint, is it fixed to an Absolute point in time - the programmers time zone - or “Current Date/Time” means the current users Timezone

Short answer: It will work correctly. (Though I presume you mean that posts are only shown if the “post date/time” is less than [in the past with respect to] current date/time.)

Longer answer:

Just like in JavaScript, dates are displayed (and constructed / understood) in the browser’s timezone, which is the only proxy we have for a user’s timezone (unless you ask a user to set a timezone preference and then do stuff in the context of that timezone, which can be a lot of extra work).

Dates (which as I always remind folks are date/time objects) represent unique points in time. At the moment it is now 8:33 AM on October 12, 2018 for me here in San Francisco (Pacific Daylight Time) and I would see the date rendered that way in the browser. If YOU are in New York (Eastern Daylight Time), you will understand “now” as 11:33 AM on October 12, 2018.

But the date object “current date/time” refers to the same point in time.

If you (in eastern time) schedule a post to go live at Noon tomorrow (10/13/18) your time, it will be visible to me after 9:00 AM tomorrow my time (here in pacific). 9:00 AM tomorrow for me is the same point in time as Noon tomorrow for you.

This topic was automatically closed after 70 days. New replies are no longer allowed.