1825775 Members
2053 Online
109687 Solutions
New Discussion

timezone

 
SOLVED
Go to solution
Tom Fellowes
Advisor

timezone

In /etc/TIMEZONE, I have TZ set to GMT0. One of our developers says that some of his code is setting the time off by 5 hours and he thinks it's because the file /etc/default/tz contains one line:
EST5EDT

I've never heard of the /etc/default/tz file. Can anyone tell me what this file is for?

TIA
5 REPLIES 5
Jeff Schussele
Honored Contributor

Re: timezone

Hi Tom,

/etc/TIMEZONE will set the default TZ initially, but *can* be overriden by any subsequent export of TZ. Remember the time in the system is constant, only how it's displayed can be manipulated. So have the developer check any .profile settings & any/all scripts run prior to starting the SW. I suspect you'll see where they're setting a new TZ value.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
John Carr_2
Honored Contributor

Re: timezone

Hi

have you tried

echo $TZ

to check that it is in fact not the default timezone.

John.
Fabio Ettore
Honored Contributor

Re: timezone

Hi,

what is the O.S. version? 11.11 or 11.00?

Anyway it is the default TIMEZONE of system.
For better comprehension: under /etc/default there is fs too.
Then when you will use

# newfs /dev/vg00/rlvol10

without specify -F system will take up vxfs because /etc/default/fs contains
LOCAL=vxfs.

The same should be for timezone; if you doesn't specify timezone /etc/default/tz should be taken.

Another problem I heard about libc. From libc patch text:

When environment variable TZ is not set, the variables
tzname[2] and timezone is set to hard coded values
corresponding to Eastern Standard Time.

Please past output of
# swlist -l product |grep -i libc

HTH.

Best regards,
Ettore
WISH? IMPROVEMENT!
Tom Fellowes
Advisor

Re: timezone

THanks for the help, but it ended up being bad code. The developer checked and his code was using tzset and he said he'd change it to use locatime or ctime or something like that. I should've posted this in a programming area anyway. Sorry.
Manish Srivastava
Trusted Contributor
Solution

Re: timezone

Hi,

The /etc/default/tz has the setting which the date and time related commands use if the TZ enviorn variable is not set. If you export the TZ in your enviorn then it overrides the default setting. Have a look at man tztab, tzset and enviorn.

Regards,
Manish.