- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- change time on hpux
Operating System - HP-UX
1821642
Members
2885
Online
109633
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-26-2011 06:27 PM
тАО05-26-2011 06:27 PM
# date
Thu May 26 18:23:23 CDT 2011
above is my hpux 11.23 time. I wanted to change 21:23 (it is three hour off). when i
use the following command...
# date -u 052521212011
date: do you really want to run time backwards?
it give me UTC time...
when i ran set_parms timezone, change it back to CST... the time become incorrect again.
Please help.
Thu May 26 18:23:23 CDT 2011
above is my hpux 11.23 time. I wanted to change 21:23 (it is three hour off). when i
use the following command...
# date -u 052521212011
date: do you really want to run time backwards?
it give me UTC time...
when i ran set_parms timezone, change it back to CST... the time become incorrect again.
Please help.
Solved! Go to Solution.
- Tags:
- TZ
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-26-2011 08:03 PM
тАО05-26-2011 08:03 PM
Solution
> # date -u 052521212011
> it give me UTC time...
man date
If you don't want to see (or specify) UTC,
then why say "-u"?
> when i ran [...]
As usual, showing actual commands with their
actual output can be more helpful than vague
descriptions or interpretations. For
example:
> [...] hpux 11.23 [...]
uname -a
> it give me UTC time...
man date
If you don't want to see (or specify) UTC,
then why say "-u"?
> when i ran [...]
As usual, showing actual commands with their
actual output can be more helpful than vague
descriptions or interpretations. For
example:
> [...] hpux 11.23 [...]
uname -a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-26-2011 10:31 PM
тАО05-26-2011 10:31 PM
Re: change time on hpux
# date -u 052521212011
This command would set the time to May 25, 21:21 UTC... or 16:21 CDT. That would change the clock backwards from the current setting.
The -u option means "UTC", not "update".
> it give me UTC time...
No, you gave the system a new time value and explicitly told that it's the current UTC time. The new local time was calculated from that value, based on the current timezone setting.
Please run "echo $TZ": it will display your current timezone setting in full.
If you have a convenient source of UTC time, for example a NTP time server, use it to set the system clock to the correct UTC time (use "ntpdate" or "date -u " to set it).
Then change the timezone setting until the local time is correct for you. When you change the timezone setting, the system's idea of the local time will adjust automatically: the system's idea of the UTC time will stay in sync with the real UTC time.
If it's more convenient for you to set the time using local time, *first* find the correct timezone setting for you, *then* set the time using "date".
In HP-UX 11.23, this is controlled by the TZ environment variable. Its system default value is set in /etc/TIMEZONE. You can experiment by changing the TZ setting in your shell session: that way, it will only take effect for the commands you run in that session. Once you find the setting that works for you, you can use "set_parms timezone" or edit /etc/TIMEZONE manually.
After making changes to /etc/TIMEZONE, you should reboot to make sure all the system daemons will be using the new setting.
CDT = Central Daylight Time. If you want CST (Central Standard Time) year-round, your TZ value should be "CST6", nothing else. It contains the timezone name and the UTC offset value: that's all the system needs.
If the TZ value includes a DST timezone name (e.g. "CST6CDT"), then the system will also look into /usr/lib/tztab to find the DST transition rules, and the system will automatically shift between DST and standard time. In this case, you should make sure your /usr/lib/tztab is up to date, as USA's DST rules have recently been changed.
The latest HP-provided tztab patch for 11.23 seems to be PHCO_39173.
You might find that the sign of the UTC offset number in the TZ variable is the opposite of what you'd expect. That's as it should be: blame the POSIX standards. It's defined as "the value you must add to the local time to get UTC time".
MK
This command would set the time to May 25, 21:21 UTC... or 16:21 CDT. That would change the clock backwards from the current setting.
The -u option means "UTC", not "update".
> it give me UTC time...
No, you gave the system a new time value and explicitly told that it's the current UTC time. The new local time was calculated from that value, based on the current timezone setting.
Please run "echo $TZ": it will display your current timezone setting in full.
If you have a convenient source of UTC time, for example a NTP time server, use it to set the system clock to the correct UTC time (use "ntpdate
Then change the timezone setting until the local time is correct for you. When you change the timezone setting, the system's idea of the local time will adjust automatically: the system's idea of the UTC time will stay in sync with the real UTC time.
If it's more convenient for you to set the time using local time, *first* find the correct timezone setting for you, *then* set the time using "date
In HP-UX 11.23, this is controlled by the TZ environment variable. Its system default value is set in /etc/TIMEZONE. You can experiment by changing the TZ setting in your shell session: that way, it will only take effect for the commands you run in that session. Once you find the setting that works for you, you can use "set_parms timezone" or edit /etc/TIMEZONE manually.
After making changes to /etc/TIMEZONE, you should reboot to make sure all the system daemons will be using the new setting.
CDT = Central Daylight Time. If you want CST (Central Standard Time) year-round, your TZ value should be "CST6", nothing else. It contains the timezone name and the UTC offset value: that's all the system needs.
If the TZ value includes a DST timezone name (e.g. "CST6CDT"), then the system will also look into /usr/lib/tztab to find the DST transition rules, and the system will automatically shift between DST and standard time. In this case, you should make sure your /usr/lib/tztab is up to date, as USA's DST rules have recently been changed.
The latest HP-provided tztab patch for 11.23 seems to be PHCO_39173.
You might find that the sign of the UTC offset number in the TZ variable is the opposite of what you'd expect. That's as it should be: blame the POSIX standards. It's defined as "the value you must add to the local time to get UTC time".
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2011 07:03 AM
тАО05-27-2011 07:03 AM
Re: change time on hpux
THANK YOU ALL. IT WORKS.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP