getTimezoneOffset
This function is used by Ignition's Expression language.
Description​
Returns the current time zone's offset versus UTC for a given instant, taking Daylight Saving Time into account.
Syntax​
getTimezoneOffset([date])
Parameters​
Type | Parameter | Description |
---|---|---|
Date | date | A specified date to compare the current timezone to UTC. If omitted, the current time will be used. [optional] |
Returns​
Float - The offset of the current timezone from UTC, considering Daylight Saving Time if applicable.
Examples​
Code Snippet
getTimezoneOffset(getDate(2017, 1, 22)) //Returns -8.0, if you are in Pacific Time.
Code Snippet
getTimezoneOffset(getDate(2017, 6, 22)) //Returns -7.0, if you are in Pacific Time, since Daylight Saving Time would be in effect.