1752777 Members
6366 Online
108789 Solutions
New Discussion юеВ

How to change CDT to CST

 
Heik
Occasional Advisor

How to change CDT to CST

Hi everyone,

Does anybody know how to change the parameter Central Daylight Time (CDT) to Central Standard Time (CST)with the date command on HP-UX??

I have this:
Wed Mar 18 10:44:10 CDT 2009

but I would like to have this:
Wed Mar 18 10:44:10 CST 2009

How do i change it?

Thanks in advance...
6 REPLIES 6
Dave Johnson_1
Super Advisor

Re: How to change CDT to CST

That is controlled by the rules in the /usr/lib/tztab file to control switching between standard time and daylight savings time.
When the rules changed in the US a couple of years ago, HP released a patch to implement a new file. Once you have that installed, the CST/CDT will display correctly.
By the way, we are in CDT right now. It started on March 8th this year.
James R. Ferguson
Acclaimed Contributor

Re: How to change CDT to CST

Hi:

Each user can establish his/her own timezone preference in their '.profile' by setting and exporting the TZ variable. Generally this is done system-wide in '/etc/profile' when the '/etc/TIMEZONE' file is sourced.

To change your system-wide setting, edit '/etc/TIMEZONE' or run '/sbin/set_parms' passing the keyword "timezone" as its argument.

To see what your time might look like, do:

# TZ=CST6 date

Regards!

...JRF...
Heik
Occasional Advisor

Re: How to change CDT to CST

Thank you guys for you help. I am trying to set the time for Mexico Zone so this is what i did:

1. Edit /usr/lib/tztab

# Central Standard Time, Central Daylight Time
CST6CDT
0 3 24-30 4 1970-1973 0 CDT5
0 3 6 1 1974 0-6 CDT5
0 3 22-28 2 1975 0 CDT5
0 3 24-30 4 1976-1986 0 CDT5
0 3 1-7 4 1987-2038 0 CDT5 -> April
0 1 25-31 10 1970-1973 0 CST6
0 1 24-30 11 1974 0 CST6
0 1 25-31 10 1975-2038 0 CST6 -> October

2. #echo $TZ
CST6CDT

3. #date 031811282009

4. #date
Wed Mar 18 11:28:00 CST 2009

then Shazammm!!! that's what I wanted. In Mexico we change the time 2 weeks after than US or Canada.

Thanks for your help!
Heik
Occasional Advisor

Re: How to change CDT to CST

Thanks for your tremendous help!
Dave Johnson_1
Super Advisor

Re: How to change CDT to CST

I took a look at the tztab file and there is already a rule for Mexico City, MXST6MXDT if that helps.
Dennis Handly
Acclaimed Contributor

Re: How to change CDT to CST

>1. Edit /usr/lib/tztab

You should do what Dave suggested and use a special timezone for Mexico, not change the one for the US.
By editing tztab, you will not be able to patch it in the future without manual intervention.