Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Conversion of Time

by Ratazong (Prior)
on Jun 20, 2012 at 14:35 UTC ( #977365=note: print w/ replies, xml ) Need Help??

in reply to Conversion of Time

You could also do it by hand, using a regex to extract the relevant info from your input-string and some hash-lookup to translate the month to a number:

my %convert = ( "Jan" => "01", "Feb" => "02", "Mar" => "03", "Jun" => +"06" ,); # ... you get the idea my $in = "Fri Jun 16 18:04:03 2012"; $in =~ /.*?\s(\w\w\w)\s(.*)$/; my $out = $convert{$1} . " " . $2;

HTH, Rata

Comment on Re: Conversion of Time
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2015-11-29 04:32 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls