Re: Testing for daylight savings on a GMT server

From: Mothra (mothra_at_nowhereatall.com)
Date: 10/31/05


Date: Mon, 31 Oct 2005 10:24:03 -0800

Hello snoopy,

snoopy_@excite.com wrote:
> Hello,
> 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.
>
(snipped)

> P.S. System OS is Solaris 2.8.

>From the DateTime Docs

* is_dst
    Returns a boolean indicating whether or not the datetime object is
    currently in Daylight Saving Time or not.

So something like this should give you what you need.

use strict;
use warnings;
use DateTime;

print DateTime->today( time_zone => 'America/Los_Angeles')->is_dst;

Hope this helps

Mothra



Relevant Pages

  • Re: Anyone have experience with dst_sync on Unixware 7?
    ... >We had a problem with one of our servers adjusting two hours ahead for ... >daylight savings time instead of one. ... >servers do) and then dst_sync adjusted it another hour. ... not that timezone is currently employing DST. ...
    (comp.os.linux.misc)
  • Re: Testing for daylight savings on a GMT server
    ... > 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. ... Returns a boolean indicating whether or not the datetime object is ...
    (comp.unix.programmer)
  • Re: Testing for daylight savings on a GMT server
    ... > 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. ... Returns a boolean indicating whether or not the datetime object is ...
    (comp.unix.shell)
  • Re: Outlook and Global Calendar
    ... Check the time and date and time zone and daylight savings time on all ... servers & workstations to make sure they're correct & match. ... Robb Edge wrote: ...
    (microsoft.public.outlook)
  • Re: Unix date
    ... Unless your two servers are in the same place you can't really make the times the same without making them wrong in one place. ... The best thing I can think of to do is specify a timezone, and daylight savings time value, that way you will know what to expect. ... "tedd" wrote in message ... But on another sever, produces: Oct 18, 2009 12:00:00 am ...
    (php.general)