Re: Testing for daylight savings on a GMT server

joe_at_invalid.address
Date: 10/31/05


Date: 31 Oct 2005 11:37:34 -0600

snoopy_@excite.com writes:

> I have a server that is set to GMT and it needs to interact with
> other servers that are not and the other servers also observe
> daylight savings time adjustments. I am trying to re-write some
> scripts that do not require any changes due to the timechange, I
> thought I found the cure via perl's localtime function, but this
> last weekend showed me that since my box is set to GMT it doesn't
> care about DST and perl won't pick up the change.
>
> Here's what I was using (our code standard is ksh):
>
> chk_dst()
> {
> DST=`/usr/bin/perl -e '($isdst) = (localtime)[8]; print
> "$isdst\n";'`
> if [ $DST == 0 ]; then
> TIME1=14
> TIME2=19
> elif [ $DST == 1 ]; then
> TIME1=15
> TIME2=20
> elif [ $DST -ge -1 ]; then
> echo "Cannot determine system time" >> /tmp/dstTime.out
> fi
> }
>
> I was hopping to see a "0" when we are out of DST, and a "1" when
> we were in DST. Neither seems to be the case. I also tried setting
> my TZ variable to a local time, but I haven't seen any changes. It
> appears the issue is that since my box is set to GMT, I won't be
> able to use perl to get the DST info. Any suggestions?
>
> P.S. System OS is Solaris 2.8.

I'm not entirely sure I understand what you're asking, but if all you
want to do is find out if DST is in effect currently for some other
timezone, just prefix a TZ assignment to the perl script, eg

TZ=CST6DST /usr/bin/perl -e '($isdst) = (localtime)[8]; print "$isdst\n";'

Joe

-- 
Gort, klatu barada nikto


Relevant Pages

  • Re: Testing for daylight savings on a GMT server
    ... > other servers that are not and the other servers also observe ... > daylight savings time adjustments. ... > scripts that do not require any changes due to the timechange, ... > care about DST and perl won't pick up the change. ...
    (comp.unix.programmer)
  • Re: Testing for daylight savings on a GMT server
    ... > other servers that are not and the other servers also observe ... > daylight savings time adjustments. ... > scripts that do not require any changes due to the timechange, ... > care about DST and perl won't pick up the change. ...
    (comp.unix.shell)
  • Re: Time issues?
    ... I started having trouble with clients having ... I'm pretty sure that we did all of the DST patches back when the gov ... In addition to SuperK's suggestions, I would recommend to go through your servers one by one at this point, to determine their current time settings and make sure they have the latest DST patch. ... Or you can just wait for the two weeks to pass, albeit with problems, until the old Daylight Savings Time schedule gets caught up. ...
    (microsoft.public.windows.server.networking)
  • Re: Slow backup issue in WSS3
    ... This is not an issue isolated to one or two WSS servers, ... Only one week left before I can dump that time patch! ... I don't remember that being a problem at first on my DST ... ten minutes to do a backup. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: DST On New Exchange
    ... whether the new Exchange server had the correct DST 2007 timezone update applied ... whether clients had the correct timezone updates applied ... DST 2007: Understanding what needs to be done and how to do it ... updating your servers with newer DST patches ...
    (microsoft.public.exchange.admin)

Quantcast