system.date.getTimezoneOffset
This function is used in Python Scripting.
Descriptionβ
Returns the current timezone's offset versus UTC for a given instant, taking Daylight Savings Time into account.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.date.getTimezoneOffset([date])
Parametersβ
| Type | Parameter | Description |
|---|---|---|
| Date | date | The instant in time for which to calculate the offset. Uses now() if omitted. [optional] |
Returnsβ
Double - The timezone offset compared to UTC, in hours.
Scopeβ
Gateway, Vision Client, Perspective Session
Code Examplesβ
Code Snippet
# This example will give the time zone offset using the date February 22, 2021
# and the computers current time zone.
date = system.date.getDate(2021, 1, 22)
print system.date.getTimezoneOffset(date) # returns -8.0 (if you are in Pacific Daylight Time)