Correct usage of tzset(), TZ env

https://knowledgebase.progress.com/articles/Article/000044163
TZ variable can be set on on for a session, user profile or use it in the Database start-up script to start the database for the specific timezone or country or city.

Following are some examples can be tested in a terminal session of UNIX.

For China is UTC+8:00 or GMT+8:00

TZ needs to set it with opposite sign as follows:

TZ=UTC-8:00; export TZ
or,
TZ=GMT-8:00; export TZ
or,
TZ=Asia/Shanghai;export TZ

setenv("TZ", "GMT-8:00", 1) tzset(); 

For US EST (GMT-5:00, New York):

TZ=UTC+5:00; export TZ
Or,
TZ=GMT+5:00; export TZ
Or,
TZ=America/New_York;export TZ

setenv("TZ", "UTC+5:00", 1) tzset(); 

Comments

Popular posts from this blog

How to fix error : no module named sendgrid when try to use sendgrid python lib in PHP.

react-native run-android : sun.security.provider.cert path.SunCertPathBuilderException : unable to find valid certification path to req uested target

react-native run-android : do not build/update modified code(App.js)