- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Timezone and daylight savings time.
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
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
Discussion Boards
Community
Resources
Forums
Blogs
- 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
04-02-2001 07:42 AM
04-02-2001 07:42 AM
Timezone and daylight savings time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2001 08:02 AM
04-02-2001 08:02 AM
Re: Timezone and daylight savings time.
The TZ variable defines the standard and daylight savings rules for your timezone, along with the number of hours that are added to universal time to arrive at local time. You don't have to change anything to accomodate the shift between standard and daylight times. Rather, these rules are pre-defined in /usr/lib/tztab.
Take a look at the man pages: 'environ (5)' and 'tztab (4)'.
'cron' (see 'man 1M cron') handles this transition between standard and daylight times without intervention too as described in its man pages.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2001 09:00 AM
04-02-2001 09:00 AM
Re: Timezone and daylight savings time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2001 09:41 AM
04-02-2001 09:41 AM
Re: Timezone and daylight savings time.
There are a number of different ways to determine the correct UTC time. The easiest way is to simply:
$ TZ=GMT date
Mon Apr 2 17:31:15 GMT 2001
Or to do this within a C program:
#include
#include
struct tm *timeg;
time_t timex;
timex = time( NULL );
timeg = gmtime( &timex );
printf( asctime( timeg ) );
This will then print out the current time in GMT. More information can be found in the man pages for time(2) and gmtime(3C).
I hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2001 10:51 AM
04-02-2001 10:51 AM
Re: Timezone and daylight savings time.
To find out when you are seven, and when you are eight hours from UTC, you can use display the date (time) as Kenneth shows, or you can look in /usr/lib/tztab as I suggested above.
For instance, comparing my local time here in Florida to UTC:
# date;TZ=GMT date
Mon Apr 2 14:49:17 EDT 2001
Mon Apr 2 18:49:17 GMT 2001
Note the absence of the semicolon between 'TZ' and 'date'. This sets the TZ variable only for the second statement.
Alternately, if I look in /usr/lib/tztab for the rules govering by timezone (EST5EDT), I can see that during days 1-7 in April (the fourth month) during the years 1987-2038, I will be four (EDT4) hours from UTC in my "(D)aylight" time period. Then, in October when the day falls from 25-31 in the years 1975-2038 my time will be 5-hours from UTC.
Normally, the TZ variable is set during login when /etc/profile is read. The variable is set by sourcing /etc/TIMEZONE if that is readable and if not, it is set to MST7MDT in the default profile.
Perhaps this helps further.
...JRF...