Converting to UTC
To convert to UTC (Coordinated Universal Time), add the TimeZoneOffset for the given time.
For example, imagine the current date and time is July 15, 2013, 1:02 PM in Pacific Daylight Time (PDT, UTC-7). To determine the current time in UTC, use:
DateAdd( Now(), TimeZoneOffset(), Minutes )
TimeZoneOffset defaults to the current time, so you don't need to pass it an argument.
To see the result, use the Text function with the format dd-mm-yyyy hh:mm, which will return 15-07-2013 20:02.
Converting from UTC
To convert from UTC, subtract the TimeZoneOffset (by adding the negative) for the given time.
For example, imagine the UTC date and time July 15, 2013, 8:02 PM is stored in a variable named StartTime. To adjust the time for the user's time zone, use:
DateAdd( StartTime, −TimeZoneOffset( StartTime ), Minutes )
Note the negative sign before TimeZoneOffset to subtract the offset rather than add it.
To see the result, use the Text function with the format dd-mm-yyyy hh:mm, which will result in 15-07-2013 13:02 if you're in Pacific Daylight Time.
Greeting,
DwayneT