Dealing with Dates and Time zones

Each platform instance has a Time zone.

The default time-zone is AEST (+10), which is a day-light saving time zone.

You can change the time zone of your instance by opening ‘Settings’ in the Control Panel.

timezones

Display

All dates are internally stored and manipulated in UTC (+0). See: http://en.wikipedia.org/wiki/Utc.

All controls will display dates in the local time zone, and treat dates entered as local dates.

The Formula evaluator will show resultant dates in UTC, and VAR_DUMP will do the same. This can be confusing as you might see a midnight value as 13:00 or 14:00 the previous day.

Time zone dependant Formula functions

Any formula function that is time zone dependent will use the current time zone; E.g. TODAY(NOW()) will get you a date time representing midnight of the current local day.

Time zones and Conversion

Dates in a particular time zone are often depicted as e.g. 12-Dec-2013 14:00 (+11) where the time zone offset is +11.

In such a situation, to get the UTC date you simply subtract the time zone offset from the date and you will get the same date in UTC

localTime = 12-Dec-2013 14:00 // at +11
utcTime   = localTime - 11 hours          = 12-Dec-2013 3:00
localTime = 12-Jan-2013 00:00 // at +10
utcTime   = localTime - 10 hours          = 11-Jan-2013 14:00

Daylight Savings

Daylight savings (See for Australia: http://en.wikipedia.org/wiki/Daylight_saving_time_in_Australia, for other countries: http://en.wikipedia.org/wiki/Daylight_saving_time_by_country) makes this a bit more complex.

In AEST we alternate between a time zone offset of +10 and +11 depending on the time of year. (We have the DST time zone offset of +11 from October to April)

We recommend not worrying too much about UTC vs local time when not absolutely necessary. Most calculations are not time zone dependent.

Related Articles