Convert GMT to North American timezones 
Author Message
 Convert GMT to North American timezones

Hi,

I need to be able to convert any GMT date/time within the last 5 years
to Pacific, Mountain, Central, or Eastern time.

Most of the modules/examples I have seen only deal with converting the
present time, only converting to local timezone, or they don't bother
to take daylight savings time into effect.

Does anybody have any ideas?



Tue, 23 Dec 2003 04:58:25 GMT  
 Convert GMT to North American timezones
Which platform are you looking at?

I already have a program that does this.

Quote:

> Hi,

> I need to be able to convert any GMT date/time within the last 5 years
> to Pacific, Mountain, Central, or Eastern time.

> Most of the modules/examples I have seen only deal with converting the
> present time, only converting to local timezone, or they don't bother
> to take daylight savings time into effect.

> Does anybody have any ideas?



Tue, 23 Dec 2003 06:05:31 GMT  
 Convert GMT to North American timezones
You have only three timezones?  Just write a function that takes two
parameters. One, the timezone (define this TZ environments variable if you
like), and another, the unix time that you want to convert.  In the body of
the function, subtract 4, 7, or 8 (or whatever) hours (or 3, 6 or 7 hours if
in daylight savings period and converting to seconds) from the first
parameter and return that.

call it like this:
my $ltime = apply_time_zone_to_time(9123423111, $ENV{TZ});
or
my $ltime = apply_time_zone_to_time(9123423111, 'Canada/Pacific');
or simplest of all:
my $ltime  = apply_time_zone_to_time(9123423111, 7);

Ed


Quote:
> Hi,

> I need to be able to convert any GMT date/time within the last 5 years
> to Pacific, Mountain, Central, or Eastern time.

> Most of the modules/examples I have seen only deal with converting the
> present time, only converting to local timezone, or they don't bother
> to take daylight savings time into effect.

> Does anybody have any ideas?



Tue, 27 Jan 2004 02:04:21 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Convert GMT time to North American times

2. Convert GMT to timezone

3. Need to convert from seconds since Unix epoch to GMT

4. Converting Non-local time to GMT

5. FormMail - Convert Time to GMT

6. PERL for Geoscientists at North Harris College (near Houston)

7. Timezones

8. Timezones

9. Module for timezones

10. How to get times in different timezones?

11. Angelina Jolie collection of American Actress Pictures

12. Are there too many Indians taking American Jobs?

 

 
Powered by phpBB® Forum Software