Re: Testing for daylight savings on a GMT server
From: Mothra (mothra_at_nowhereatall.com)
Date: 10/31/05
- Next message: Enrique Perez-Terron: "Re: Testing for daylight savings on a GMT server"
- Next in thread: Enrique Perez-Terron: "Re: Testing for daylight savings on a GMT server"
- Maybe reply: Enrique Perez-Terron: "Re: Testing for daylight savings on a GMT server"
- Maybe reply: Jordan Abel: "Re: Testing for daylight savings on a GMT server"
- Maybe reply: Logan Shaw: "Re: Testing for daylight savings on a GMT server"
- Maybe reply: snoopy__at_excite.com: "Re: Testing for daylight savings on a GMT server"
- Maybe reply: Bart Lateur: "Re: Testing for daylight savings on a GMT server"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Enrique Perez-Terron: "Re: Testing for daylight savings on a GMT server"
- Next in thread: Enrique Perez-Terron: "Re: Testing for daylight savings on a GMT server"
- Maybe reply: Enrique Perez-Terron: "Re: Testing for daylight savings on a GMT server"
- Maybe reply: Jordan Abel: "Re: Testing for daylight savings on a GMT server"
- Maybe reply: Logan Shaw: "Re: Testing for daylight savings on a GMT server"
- Maybe reply: snoopy__at_excite.com: "Re: Testing for daylight savings on a GMT server"
- Maybe reply: Bart Lateur: "Re: Testing for daylight savings on a GMT server"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|