Sponsored Content
Full Discussion: DST script for 5.0.0
Operating Systems SCO DST script for 5.0.0 Post 302107293 by Perderabo on Thursday 15th of February 2007 11:29:39 PM
Old 02-16-2007
There may be an option for you. On the OpenServer environ man page it says:
Quote:
TZ
Defines time zone information. This information is used by date(C) to display the appropriate time. The variable may have any value of the form:

std offset [ dst [ offset ],[ start [ /time ], end [ /time ]]]

(You may also have:

std offset [ dst [ offset ];[ start [ /time ], end [ /time ]]]

which is the XENIX format. Note that this format is not POSIX compatible.)

std, the standard local time zone abbreviation (1-9 characters), and offset, the difference between the local time and GMT, are the only mandatory fields.

offset should be specified as:

[ + | - ] hh [ :mm [ :ss ]]

where hh is hours (0-24), mm is minutes (0-59), and ss is seconds (0-59). Only the hours field is mandatory. If offset is preceded by a minus (-), it is east of the Prime Meridian, otherwise it is assumed to be west (this can be specified with an optional plus (+)).

dst is a 1-9 character abbreviation for the local summertime timezone. If dst is not specified, the system will not be aware of summertime; it will always be on standard time.

The offset after dst is the difference between local standard time and local summertime. If you do not specify an offset, it is assumed to be one hour. (This is usually what you want.)

Everything following the second offset is the rule for when to change from standard to summertime. start/time is when the change to summertime occurs; end/time is when the time changes back. (Note that, for systems in the Southern Hemisphere, start/time does not have to come earlier in the year than end/time.)

start and end describe the day, while time specifies the time. time is specified in the same way as offset (see above), but the leading ``+'' or ``-'' is not valid. If time is not specified, it is assumed to be 02:00:00 (2 A.M.).

start and end can be specified in any of the following ways:


Jn
The Julian day (1-365). Leap years are not counted; February 28 is day 59 and March 1 is day 60, always.

n
The zero-based Julian day (0-365); you can refer to February 29 in a leap year.

Wn.d
The dth day (0-6, where 0 is Sunday) of week n (1-4).

Mm.n.d
The dth day (0-6, where 0 is Sunday) of week n (1-5) of month m (1-12). If you specify the week (n) as 5, this means the last d day in m month, as in M8.5.1 which would be the last Monday in August.

If you specify the comma starting off the summertime rule, it is advisable to specify the rest of the rule.

A sample TZ for Eastern Standard Time, EST, might look like this:

EST5:00:00EDT4:00:00,M4.1.0/2:00:00,M10.5.0/2:00:00.

We start off with ``EST5:00'': this names our time zone and defines it as five hours west of Greenwich Mean Time. Summertime in this locale is called EDT (Eastern Daylight Time), and is four hours ahead of GMT. Summertime starts on a Sunday in the first week in April at 2 A.M., and standard time resumes on the last Sunday in October at 2 A.M.

Refer to the tz(M) and timezone(F) manual pages for more information on TZ.
For the revised rule:
EST5:00:00EDT4:00:00,M3.2.0/2:00:00,M11.1.0/2:00:00
should work for the Eastern Zone. But I can't test it.
 

10 More Discussions You Might Find Interesting

1. Solaris

DST on Solaris 2.6/7

I have several servers that are outside the country and are running Solaris 6 mainly with a few Solaris 7 boxes here and there. Because of that, we need to schedule time to change the time on March 11th and again in April, October and November. At least until the customer decides it's time to... (3 Replies)
Discussion started by: BOFH
3 Replies

2. SCO

Dst - V 3.6.3

Hello, Anyone know where I can find the DST updates for SCO Xdesktop 3.6.3? Thanks (0 Replies)
Discussion started by: ddzc
0 Replies

3. UNIX for Dummies Questions & Answers

How to verify DST Update

Hello, Does anyone know how can I verify if the DST update on a SCO Unixware system has been installed successfully? UNIXWARE 7.1.4 MP3 Looking forward to some help, please.... Thanks (8 Replies)
Discussion started by: Yorgy
8 Replies

4. AIX

AIX and DST

Just a quick last minute thing here. AIX 5.1. I ran the perl script referenced in the tutorials and found the AIX box is triggering DST on the 14th instead of the 11th. The 5.2 boxes come back with the right answers. The DST patches have been applied (or I'd have Apr 1st instead of the 14th). ... (0 Replies)
Discussion started by: BOFH
0 Replies

5. Solaris

DST Patch

How to update DST patch. Whatat are the necessary steps that have to be taken on the servers to update this patch?. (1 Reply)
Discussion started by: sandeepkv
1 Replies

6. What is on Your Mind?

The Switch to DST 2007 --- How Did It Go?

We have been discussing the 2007 changes to DST (Daylight Saving Time) for some time now. We hope that everything went well. But did it? Let us know by voting or by posting your experiences here. The poll will automatically close in 45 days. (6 Replies)
Discussion started by: Perderabo
6 Replies

7. Shell Programming and Scripting

DST Change For Australia

Hello , We are investigating an issue from a customer from Western Australia related to DST change on 25 th March. The customer in Australia has the below settings for Time Zone. The System is Solaris 9. TZ=Australia/NSW CMASK=022 We are trying to reproduce the problem in our local... (1 Reply)
Discussion started by: Mohammed
1 Replies

8. Linux

my server is 1 hour behind after DST

Hello, I have linux server which is one hour behind after the DST change last week. I post some information below on the settings. any helpwould be helpful since I am newbie.. $ clock Tue 04 Nov 2008 03:12:26 PM EST -0.785549 seconds $more clock Tue 04 Nov 2008 03:12:26 PM EST... (2 Replies)
Discussion started by: jbdavis02@yahoo
2 Replies

9. Shell Programming and Scripting

Determine if given date is in DST

Is there a way to figure out if given date is in DST or in EST? So imagine a shell script is_date_dst.sh sh is_date_dst.sh 2009-03-02 would return 0 and sh is_date_dst.sh 2009-03-22 would return 1 This script should not assume the timezone of the machine it runs on, but only the date passed... (7 Replies)
Discussion started by: asriva
7 Replies

10. UNIX for Advanced & Expert Users

Handle Autosys with DST Changes

Hi, I have one confusion regarding DST chnages which are going to happen after October. :confused: :confused: I have few jobs on Autosys which run as per Japan Time. they shoudl not be affected by switiching off of DST time. Our autosys instance server is based on UK which is running on... (0 Replies)
Discussion started by: girdharsourabh
0 Replies
TZSET(3)						   BSD Library Functions Manual 						  TZSET(3)

NAME
tzset, tzsetwall -- initialize time conversion information LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <time.h> void tzset(void); void tzsetwall(void); DESCRIPTION
The tzset() function initializes time conversion information used by the library routine localtime(3). The environment variable TZ specifies how this is done. If TZ does not appear in the environment, the best available approximation to local wall clock time, as specified by the tzfile(5)-format file /etc/localtime, is used. If TZ appears in the environment but its value is a null string, Coordinated Universal Time (UTC) is used (without leap second correction). If TZ appears in the environment and its value begins with a colon (':'), the rest of its value is used as a pathname of a tzfile(5)-format file from which to read the time conversion information. If the first character of the pathname is a slash ('/'), it is used as an absolute pathname; otherwise, it is used as a pathname relative to the system time conversion information directory. If its value does not begin with a colon, it is first used as the pathname of a file (as described above) from which to read the time conver- sion information. If that file cannot be read, the value is then interpreted as a direct specification (the format is described below) of the time conversion information. If the TZ environment variable does not specify a tzfile(5)-format file and cannot be interpreted as a direct specification, UTC is used. The tzsetwall() function sets things up so that localtime returns the best available approximation of local wall clock time. SPECIFICATION FORMAT
When TZ is used directly as a specification of the time conversion information, it must have the following syntax (spaces inserted for clar- ity): std offset [dst [offset] [, rule]] Where: std and dst Three or more bytes that are the designation for the standard (std) or summer (dst) time zone. Only std is required; if dst is missing, then summer time does not apply in this locale. Upper and lowercase letters are explicitly allowed. Any characters except a leading colon (':'), digits, comma (','), minus ('-'), plus ('+'), and ASCII NUL are allowed. offset Indicates the value one must add to the local time to arrive at Coordinated Universal Time. The offset has the form: hh[:mm[:ss]] The minutes (mm) and seconds (ss) are optional. The hour (hh) is required and may be a single digit. The offset follow- ing std is required. If no offset follows dst, summer time is assumed to be one hour ahead of standard time. One or more digits may be used; the value is always interpreted as a decimal number. The hour must be between zero and 24, and the minutes (and seconds) -- if present -- between zero and 59. If preceded by a ('-') the time zone shall be east of the Prime Meridian; otherwise it shall be west (which may be indicated by an optional preceding ('+')). rule Indicates when to change to and back from summer time. The rule has the form: date/time,date/time where the first date describes when the change from standard to summer time occurs and the second date describes when the change back happens. Each time field describes when, in current local time, the change to the other time is made. The format of date is one of the following: J n The Julian day n (1 <= n <= 365). Leap days are not counted; that is, in all years -- including leap years -- February 28 is day 59 and March 1 is day 60. It is impossible to explicitly refer to the occasional February 29. n The zero-based Julian day (0 <= n <= 365 ) . Leap days are counted, and it is possible to refer to February 29. M m.n.d The d'th day (0 <= d <= 6) of week n of month m of the year (1 <= n <= 5), (1 <= m <= 12), where week 5 means ``the last d day in month m'' which may occur in either the fourth or the fifth week). Week 1 is the first week in which the d'th day occurs. Day zero is Sunday. The time has the same format as offset except that no leading sign ('-') or ('+') is allowed. The default, if time is not given, is 02:00:00. If no rule is present in the TZ specification, the rules specified by the tzfile(5)-format file posixrules in the system time conversion information directory are used, with the standard and summer time offsets from UTC replaced by those spec- ified by the offset values in TZ. For compatibility with System V Release 3.1, a semicolon (';') may be used to separate the rule from the rest of the specification. FILES
/etc/localtime local time zone file /usr/share/zoneinfo time zone directory /usr/share/zoneinfo/posixrules rules for POSIX-style TZ's /usr/share/zoneinfo/GMT for UTC leap seconds If the file /usr/share/zoneinfo/GMT does not exist, UTC leap seconds are loaded from /usr/share/zoneinfo/posixrules. SEE ALSO
date(1), gettimeofday(2), ctime(3), getenv(3), time(3), tzfile(5) HISTORY
The tzset() and tzsetwall() functions first appeared in 4.4BSD. BSD
November 17, 1993 BSD
All times are GMT -4. The time now is 08:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy