Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to convert date like: 19 Aug 12:00 PM EDT to a perl structure

by Intermediate Dave (Novice)
on Aug 17, 2015 at 01:44 UTC ( [id://1138810]=note: print w/replies, xml ) Need Help??


in reply to How to convert date like: 19 Aug 12:00 PM EDT to a perl structure

You could also just "roll your own" with a few lines of code. Make a hash where the three-letter abbreviation for each month is the key, and the value is its numerical equivalent. Then...
print "$months{$2}/$1/2015" if $ugly_date =~ /([0-3]?[[0-9]) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) .*/ # Returns 8/19/2015>
Though you'd probably want to set a $current_year variable with a call to your system
  • Comment on Re: How to convert date like: 19 Aug 12:00 PM EDT to a perl structure
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-20 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found