Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
sub fromGMT { my ($date, $hms) = @_; my ($Y, $M, $D) = unpack('A4A2A2',$date); my ($H, $M, $S) = $hms =~ m/^(\d+):(\d+):?(\d+)?/; $S ||= 0; $dt=DateTime->new(year=>$Y, month=>$M, day=>$D, hour=>$H,minute=>$M +,second=>$S,time_zone=>'GMT'); $dt->set_time_zone('America/Chicago'); $dt->is_dst() and $dt->add( hours=>1 ); # Unneeded return $dt->hms; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GMT to Chicago TIme
by ikegami (Patriarch) on May 21, 2010 at 21:06 UTC | |
|
Re: GMT to Chicago TIme
by Marshall (Canon) on May 22, 2010 at 01:11 UTC | |
by ikegami (Patriarch) on May 22, 2010 at 01:54 UTC | |
by Marshall (Canon) on May 22, 2010 at 03:06 UTC |