Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

uncorrect time setting

Kirill Cherkashin
Frequent Advisor

uncorrect time setting

Hi everyone,

when I execute date on different verson of Tru64 I get different answers.I mean I lost information about time zone(Moscow) for second output.

Question. How I could fix this problem? Does exist some special patch from HP on this matter? Or I need to compile timezone by myself?

> uname -a
OSF1 V5.1 732 alpha
> date
Tue Apr 29 13:01:09 MSD 2003
>

----------------

> uname -a
OSF1 V4.0 1229 alpha
> date
Tue Apr 29 12:55:32 ???? 2003

Kirill
9 REPLIES
Ralf Puchner
Honored Contributor

Re: uncorrect time setting

the output of "date" depend on your locale setting. So please post also the "locale" output and the output of "env |grep TZ".

Help() { FirstReadManual(urgently); Go_to_it;; }
Ralf Puchner
Honored Contributor

Re: uncorrect time setting

sample:

> date
Tue Apr 29 12:35:10 2003

set locale to standard C definition
> setenv LC_ALL C
> date
Tue Apr 29 12:35:50 MEST 2003

Help() { FirstReadManual(urgently); Go_to_it;; }
Kirill Cherkashin
Frequent Advisor

Re: uncorrect time setting



> uname -a
OSF1 V4.0 1229 alpha
> locale
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=

--------
> uname -a
OSF1 V5.1 732 alpha

> locale
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=


variable TZ doesn't set for both machines.
Ralf Puchner
Honored Contributor

Re: uncorrect time setting

I've tried it on an 4.0f and 5.1A/B machine. Login via normal user uses the locale settings. After using the command LC_ALL=C the timezone was shown.

Login via root leads automatically to the timezone info.

Please try to set the LC_ALL variable and check if output differs. What patchkit is installed on 4.0f? (btw. 4.0f is out of support, no engineering support at all).
Workaround on 4.0f is to substitute the command via login shell like

date'=date +"%a %b %d %r %Z %Y"

leading to the correct output.

Check also if there is still a command substitution in one of your login files by using

which date




Help() { FirstReadManual(urgently); Go_to_it;; }
Ralf Puchner
Honored Contributor

Re: uncorrect time setting

I've tried it on an 4.0f and 5.1A/B machine. Login via normal user uses the locale settings. After using the command LC_ALL=C the timezone was shown.

Login via root leads automatically to the timezone info.

Please try to set the LC_ALL variable and check if output differs. What patchkit is installed on 4.0f? (btw. 4.0f is out of support, no engineering support at all).
Workaround on 4.0f is to substitute the command via login shell like

date='date +"%a %b %d %r %Z %Y"'

leading to the correct output.

Check also if there is still a command substitution in one of your login files by using

which date




Help() { FirstReadManual(urgently); Go_to_it;; }
Ramkumar Devanathan
Honored Contributor

Re: uncorrect time setting

Hi Kirill,

add/modify the following in your /etc/TIMEZONE file -

TZ=GMT[+|-]

HTH.

- ramd.
HPE Software Rocks!
rachel_11
Advisor

Re: uncorrect time setting

Tru64 is using zoneinfo files.
Look at directory /etc/zoneinfo/sources
You will find the file europe you need to edit.

When setting correctly the standard & daylight
saving time run the command zic
watch the setting with command zdump

An example from my system:
# cd /etc/zoneinfo/sources
edit the file asia
change the two lines of 2003 to be:
Rule Zion 2003 only - Mar 28 1:00 1:00 D
Rule Zion 2003 only - Oct 3 1:00 0 S
# zic -l Israel -v asia
# zdump -v Israel | grep 2003
Israel Wed Apr 9 11:31:26 2003 IDT
Israel Thu Mar 27 22:59:59 2003 GMT = Fri Mar 28 00:59:59 2003 IST isdst=0 gmt0
Israel Thu Mar 27 23:00:00 2003 GMT = Fri Mar 28 02:00:00 2003 IDT isdst=1 gmt0
Israel Thu Oct 2 21:59:59 2003 GMT = Fri Oct 3 00:59:59 2003 IDT isdst=1 gmt0
Israel Thu Oct 2 22:00:00 2003 GMT = Fri Oct 3 00:00:00 2003 IST isdst=0 gmt0

Re: uncorrect time setting

the date command looks at the /etc/zoneinfo/localtime symbolic link to determine how to represent the time. The time is always the same in the kernel. All you will need to do is appropriately set the link and perhaps then change the time. Here is an example:

calvin.alf.cpqcorp.net:> cd /etc/zoneinfo
calvin.alf.cpqcorp.net:> ls -l localtime
lrwxrwxrwx 1 root system 16 Apr 10 2002 localtime -> America/New_York
calvin.alf.cpqcorp.net:> rm localtime
calvin.alf.cpqcorp.net:> date
Tue Apr 8 19:06:34 GMT 2003

(note the output above is GMT if the localtime link is removed)

calvin.alf.cpqcorp.net:> ln -s EST localtime
calvin.alf.cpqcorp.net:> date
Tue Apr 8 14:06:49 EST 2003
calvin.alf.cpqcorp.net:> rm localtime
calvin.alf.cpqcorp.net:> ln -s America/New_York localtime
calvin.alf.cpqcorp.net:> date
Tue Apr 8 15:07:26 EDT 2003

The time changes are immediate.

Cheers,
Christian Klein
HP Tru64 Unix Support
Ralf Puchner
Honored Contributor

Re: uncorrect time setting

The timezone settings specifies the difference of the local time and some additional information of the timezone. The locale settings specifies how the format of the time/date output will be shown.

The locale "C" settings contains per specification the timezone field. Have a look to my reply for an example.
Help() { FirstReadManual(urgently); Go_to_it;; }