Re: HP-UX time setting (1054 Views)
Reply
Regular Advisor
Yarok
Posts: 106
Registered: ‎12-28-2010
Message 1 of 7 (1,054 Views)
Accepted Solution

HP-UX time setting

Dears,

Since our contry moved into "summer clock" - 1 hour forwards, I would like to set this change in my HP-UX machine. Now the time zone is according to UTC, and there is no out source for updating the time.

BR,

Yaron
Please use plain text.
Regular Advisor
moonchild
Posts: 226
Registered: ‎03-08-2006
Message 2 of 7 (1,054 Views)

Re: HP-UX time setting

you can use:
/sbin/set_parms timezone

A list of defined timezones is in /usr/lib/tztab

you can find more info in man tztab.
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,901
Registered: ‎03-06-2006
Message 3 of 7 (1,054 Views)

Re: HP-UX time setting

You need to pick the correct timezone for your country and export TZ to that value.
See tztab(4).
Please use plain text.
Regular Advisor
Yarok
Posts: 106
Registered: ‎12-28-2010
Message 4 of 7 (1,054 Views)

Re: HP-UX time setting

Hello,

since the HP machines doesn't receive any synchronization time form out source I used set_parms date_time to define the time (UTC+3).

Then I tried ls -l command and it shows only the MM and the YY of the creation time for each file. No indication of time (Hour:Min) as was before.


I fixed the problem by using the command:

date MM/DD/HH/Mn
Yes
Ent

My questions are:

1.
How can I set the time zone without out sync source?
2.
Is there a way for ls -l to display all the following - YY/MM/DD hour:min ?

BR,

Yaron

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,901
Registered: ‎03-06-2006
Message 5 of 7 (1,054 Views)

Re: HP-UX time setting

[ Edited ]

>Then I tried ls -l command and it shows only the MM and the YY of the creation time for each file. No indication of time (Hour:Min) as was before.

This happens for:
If the time of last modification is greater than six months ago, or any time in the future, the year is substituted for the hour and minute of the modification time.

>How can I set the time zone without out sync source?

The timezone has nothing to do with NTP.

>Is there a way for ls -l to display all the following - YY/MM/DD hour:min?

This requires you to modify ls.cat:
http://h30499.www3.hp.com/t5/System-Administration/format-YYmmdd-for-ls/m-p/4523334#M367324

http://h30499.www3.hp.com/t5/System-Administration/list-file-creadted-year-using-ll-cmd/m-p/4479934#...

Please use plain text.
Regular Advisor
Yarok
Posts: 106
Registered: ‎12-28-2010
Message 6 of 7 (1,054 Views)

Re: HP-UX time setting

Dennis,

Do you know what should I set in the set_parms to be the Time Zone for local time which is UTC +3 hours?

I put UTC+3

Is that shuold work for good? I mean even when the local time will changed again to the "winter clock" (UTC+2)?

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,901
Registered: ‎03-06-2006
Message 7 of 7 (1,054 Views)

Re: HP-UX time setting

>Is that should work for good? I mean even when the local time will changed again to the "winter clock" (UTC+2)?

No. The only why it works for good is if you have a TZ value in /usr/lib/tztab that matches your countries particular start and stop times.
You then put that in /etc/TIMEZONE.
And make sure that "date -u" matches UTC time.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation