Operating System - HP-UX
1823229 Members
3594 Online
109648 Solutions
New Discussion юеВ

Re: Where does /usr/lib/tztab log the time of change??

 
Cresswell Williams
Frequent Advisor

Where does /usr/lib/tztab log the time of change??

Hi Experts

Can anyone please tell me where can I check when a time change occured on my system (HPUX11.23). The /usr/lib/tztab file changed the time one hour back for DST, but I can't find the log file to show when this occured. /var/adm/syslog/syslog.log does not show me anything regarding this change.

Thank you

ACW
9 REPLIES 9
Pete Randall
Outstanding Contributor

Re: Where does /usr/lib/tztab log the time of change??

The time doesn't change, what changes is how it's displayed. If you want to know when the time display changed for DST, you need to look at the tztab file itself. Match your TZ setting ( echo $TZ ) to an entry in tztab and it will tell you when the change occurs. For me, the relevant line looks like this:

0 3 8-14 3 2007-2038 0 EDT4

which specifies the minute (0), hour (3), day of the month (8-14), month of the year (3), year (2007-2038), day of the week (0), and the adjustment string (EDT4). So, on the 1st Sunday of the second week in March, at 3:00 AM, my time display switched to one hour earlier: EDT4 rather than EST5.

The man pages for tztab can help you figure this out.


Pete

Pete
Cresswell Williams
Frequent Advisor

Re: Where does /usr/lib/tztab log the time of change??

Thanks for your reply.

So does this mean that, even if the time display changes on an O/S level, that the application will not neccessarily see that change?
Dennis Handly
Acclaimed Contributor

Re: Where does /usr/lib/tztab log the time of change??

>Pete: If you want to know when the time display changed for DST, you need to look at the tztab file itself. The man pages for tztab can help you figure this out.

If you want this confirmed, you can use Clay's dst.pl script to decode tztab(4).
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1210672
http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1209662
http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1165833
Dennis Handly
Acclaimed Contributor

Re: Where does /usr/lib/tztab log the time of change??

>So does this mean that, even if the time display changes on an OS level, that the application will not necessarily see that change?

That's the point, the time does NOT change for the OS, only its display at the application level.
It only changes if you use libc routines to format the time in local time.
Pete Randall
Outstanding Contributor

Re: Where does /usr/lib/tztab log the time of change??

Depends on the application's environment. As long as TZ is set properly, the application will see the time accordingly. Yet, if you have users scattered across different timezones, they (and their applications) will see the appropriate local time, as long as TZ is set accordingly.


Pete

Pete
Cresswell Williams
Frequent Advisor

Re: Where does /usr/lib/tztab log the time of change??

Thanks Guys

But, now, how do i implement Daylight Savings Time, so that the time changes and not just the display?

Is there and patch for this aka, Windhoek Namibia Timezone patch?
James R. Ferguson
Acclaimed Contributor

Re: Where does /usr/lib/tztab log the time of change??

Hi:

> But, now, how do i implement Daylight Savings Time, so that the time changes and not just the display?

You are missing the point. Time does NOT change. The number of seconds since the epoch (for Unix, January 1. 1970) steadily advances.

What changes is your PERCEPTION of time. The TZ variable is the positive or negative offset from Universal (Greenwich) time.

When daylight saving time is in effect, the OFFSET from UTC is changed (usually by one hour) compared to what that OFFSET from UTC is during the other part of the year.

Daylight Saving time is a political adjustment of time.

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Where does /usr/lib/tztab log the time of change??

>Is there and patch for this aka, Windhoek Namibia Timezone patch?

Are you asking for a new timezone added to tztab(4)?

If so, you'll either have to do it yourself or meet certain criteria. If you would like an official HP-UX entry for your timezone you first must:
1) Meet the minimum population and sales numbers
2) Contact your local HP sales office
3) Provide an official government paper or web site that explains your timezone rules in a manner that is unambiguous. I.e. at this date AND time it is X, a minute later it switches to Y. And it a minute before it switches, it is X and a minute later it is Y.
Cresswell Williams
Frequent Advisor

Re: Where does /usr/lib/tztab log the time of change??

Thank Gents...