Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: Daylight Savings Time twist

by BigLug (Chaplain)
on Feb 07, 2003 at 23:01 UTC ( [id://233623]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Daylight Savings Time twist
in thread Daylight Savings Time twist

Once again, I have posted the wrong solution. The above solution will give you a time difference if you subtract here from there. However to get the equivlent there time for a particular here time, do this:
use DateTime; %OurLogs = get_the_time_from_the_log_file_as_a_hash(); $here = DateTime->new( time_zone => 'America/Indiana', map { $_ => $OurLogs{$_} } qw( year month day hour minute second ) ); $there = $here->clone; $there->set_time_zone('America/Los_Angeles');
This will give you the equivlent time in LA for the time in Indiana. Please note that you should set the timezones to appropriate values :)

Many appologies for all the confusion. I woke up at about 3am in a cold sweat realising that I'd posted the wrong solution :)

Replies are listed 'Best First'.
Re: Re: Re: Re: Daylight Savings Time twist
by kanwisch (Sexton) on Feb 17, 2003 at 17:24 UTC
    Ok, all, I REALLY appreciate the comments back. Learned quite a bit in the exercise. In this case, they guy who's taking over for me is a real PL/SQL (Oracle) nut; I read this thread, and liked it best.

    I urged him to make use of it, and he tried it out, kinda liked it, but opted to use an Oracle function to handle the time shift and write a simple Perl piece that used ranges to give a proper time range. The range is based on whether or not we are between the first Sunday in April and the last Sunday in October or not. It, admittedly, was simple, but isn't the most efficient solution (of which I think BigLug's probably is).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://233623]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found