Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Converting datetime string to valid localtime value (seconds)

by vladb (Vicar)
on May 16, 2003 at 18:10 UTC ( #258721=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use Date::Manip;
    ...
        my $time = Date_SecsSince1970($mon{$mon}, $d, $y, $h, $mn, $s) + $
    +zf*$zsec;
        print "parsed time: ".localtime($time)."; original: $date $zone\n"
    +;
    }
    
  2. or download this
    (1.2.3.4, 15/May/2003:01:05:02, -0600, "GET /foobar")
    Log date values: 5, 15, 2003, 01, 05, 02
    *** ERROR ***>> Date_SecsSince1970(5, 15, 2003, 01, 05, 02) = Wed May 
    +14 18:05:02 2003 <<***
    parsed time: Wed May 14 12:05:02 2003; original: 15/May/2003:01:05:02 
    +-0600
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://258721]
Approved by cciulla
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2014-12-26 15:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls