Operating System - HP-UX
1834705 Members
2418 Online
110069 Solutions
New Discussion

How to change date : from BST to GMT ?

 
SOLVED
Go to solution
OLIVA_1
Regular Advisor

How to change date : from BST to GMT ?


Hello,

When I type the command "date" the result is :

#date
Tue Apr 15 17:41:45 BST 2003

I wish change BST to GMT, can someone help me ?

Thanks,
11 REPLIES 11
Pete Randall
Outstanding Contributor

Re: How to change date : from BST to GMT ?

/sbin/set_parms timezone
should do it for you.


Pete

Pete
Zafar A. Mohammed_1
Trusted Contributor

Re: How to change date : from BST to GMT ?

export TZ=GMT5


Zafar A. Mohammed_1
Trusted Contributor

Re: How to change date : from BST to GMT ?

$date -u
OLIVA_1
Regular Advisor

Re: How to change date : from BST to GMT ?

Thanks,

Do you know if this modification is permanent... for instance after a reboot ?

Another question, which files are concerned by this modification ?


Thanks,
Jeff Schussele
Honored Contributor

Re: How to change date : from BST to GMT ?

Hi,

You only need to change your TZ variable.

export TZ=GMT0

then try your date again.
I'm curious - are you in an area that does not use British Summer Time?

I suspect that your default system time (set by set_parms timezone) is GMT0BST & you've now shifted to the British Summer Time & that's why the date is now showing BST.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Zafar A. Mohammed_1
Trusted Contributor

Re: How to change date : from BST to GMT ?

Setting the Time Zone (TZ)
/sbin/set_parms sets your time zone upon booting. If you have to reset
the time zone, you can use /sbin/set_parms.

You can also check
http://docs.hp.com/hpux/pdf/B2355-90742.pdf

Chapter#3 Section Making Adjustment

Thanks
Zafar
Jeff Schussele
Honored Contributor

Re: How to change date : from BST to GMT ?

Hi,

Check /etc/default/tz

That's where the default TZ is held.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
James R. Ferguson
Acclaimed Contributor

Re: How to change date : from BST to GMT ?

Hi:

The actual time of a server should not change nor does not need to change for timezone representation.

The envrionmental variable TZ holds the timezone as defined in '/usr/lib/tztab'.

A global declaration for TZ is placed in '/etc/TIMEZONE'. This is sourced when a login occurs and '/etc/profile' is read. Indivicual users can (and are free to) set their own TZ value in their own profiles, scripts or for the duration of a command only, as, for instance:

# TZ=MST7MDT date;date

...which would return the current date and time in US Mountain time and in the server's local time.

Regards!

...JRF...
John Dvorchak
Honored Contributor

Re: How to change date : from BST to GMT ?

the file /etc/TIMEZONE is sourced by /etc/profile and the env var TZ is set there.
If it has wheels or a skirt, you can't afford it.
Olivier ROBERT
Frequent Advisor
Solution

Re: How to change date : from BST to GMT ?

Pete's method changes the default time display and is permanent (survives across reboots).
Zafar's "export" method changes the date display in your current session only, it doesn't survive a logout, not to say a reboot.
Zafar's "date" method displays UTC once only.

The affected files are only one: /etc/TIMEZONE

Hope this helps,

Olivier
OLIVA_1
Regular Advisor

Re: How to change date : from BST to GMT ?


PERFECT, thanks to all !