in reply to Re: Determining Daylight Savings Time
in thread Determining Daylight Savings Time
The reason is that I'm doing timezone conversion. The code is supposed to be high-availability ... it is very bad if times get snookered even a couple times a year.
I'm using Date::Manip to perform the conversion. Date::Manip understands MST and MDT, but it does not understand something like MST7MDT. For example,
gives#!/usr/bin/perl use strict; use Date::Manip; my $date = &ParseDate("2002-05-29 08:00:00"); print "The unconverted date is [".&UnixDate($date,"%Y-%m-%d %H:%M:%S") +."]\n"; my $from = 'MDT'; my $to = 'GMT'; my $converted = &Date_ConvTZ($date,$from,$to); print "The conversion from [$from] resulted in [".&UnixDate($converted +,"%Y-%m-%d %H:%M:%S")."]\n"; $from = 'MST7MDT'; $converted = &Date_ConvTZ($date,$from,$to); print "The conversion from [$from] resulted in [".&UnixDate($converted +,"%Y-%m-%d %H:%M:%S")."]\n";
The unconverted date is [2002-05-29 08:00:00] The conversion from [MDT] resulted in [2002-05-29 14:00:00] The conversion from [MST7MDT] resulted in [2002-05-29 08:00:00]
So I need to know whether a given date is in Mountain Daylight Time or Mountain Standard Time.
Edit by tye to change PRE tags to CODE tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Determining Daylight Savings Time
by maverick (Curate) on May 29, 2002 at 22:01 UTC | |
|
(MeowChow) Re3: Determining Daylight Savings Time
by MeowChow (Vicar) on May 30, 2002 at 19:23 UTC |