How can I determine my time zone offset using VBScript?
The Windows OS provides the TZ
environment variable. For Eastern Standard Time (New York), its value is EST5EDT
. However, I am looking for the signed integer offset from UTC. (This is -5 for Eastern Standard Time.)
Here is a revised function that appears to account for Daylight Saving Time. (Inspired by this SO question.)
[Original function that does NOT account for Daylight Saving Time.]
Here is my answer to my question (original source).
For Eastern Standard Time (New York), this VBScript function will return -5: