:: RootR :: | Hosting | Order | Map | Login | Secure Inter-Network Operations | |
TZ
envronment variable.
Many software programs supporting Time Zones and international time formats,
make use of this setting. It takes care of the hours and minutes offsets,
of the winter time offset policy (which changes from a country to another),
and also of the Date shift (plus or minus one day)./usr/share/zoneinfo/
Here are some typical example how to set this TZ
for you.
replace "America/New_York" with the appropriate timezoneBourne shell family, such as sh, bash, Korn shells, and also Zsh: | export TZ=America/New_York |
C-Shell, csh and tcsh: | setenv TZ America/New_York |
From a perl script: | $ENV{TZ} = "America/New_York"; %ENV is a global hash, directly tied to the environment. |
From a ruby script: | ENV["TZ"] = "America/New_York"; This affects the environment directly. |
From a python script: | import os |
In Standard C: |
#include <stdlib.h> Or better and safer:
#include <err.h>
|
From inside PostGreSQL: | SET TIME ZONE "America/New_York"; To display it: SHOW TIME ZONE; See also: SQL syntax for SET Date-time support in PostGreSQL Time zone list from PostGreSQL's manual. rootr.net's PostGreSQL FAQ |
From a PHP script: | putenv("TZ=America/New_York"); |
From Inside MySQL: | There is no easy way to set TZ , even in recent versions.
Some future version may paliate this. Nethertheless, your application
can rely on rootr.net's server timezone being consistent.
Altougth it cannot be set from inside, the timezone can be retrieved
from the variables list:SHOW VARIABLES; Users running their own mysqld server can set TZ
with the shell, typically when starting safe_mysqld. |
:: Contact Information :: ©2024 ROOTR :: |