Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

How to format timestamps M/D/Y h:mm:ss AMPM (e.g., 4/8/2013 6:09:03 PM)?

by Jim (Curate)
on May 13, 2013 at 19:51 UTC ( [id://1033345]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        # Remove leading zeros from months, days and hours,
        # but not from minutes or seconds...
        $timestamp =~ s{(?<!:)0(?=[1-9][/:])}{}g;
    
  2. or download this
    #!perl
    
    ...
    20110501 18:09:44
    20110909 20:02:42
    20130408 18:09:03
    
  3. or download this
    #!perl
    
    ...
    20110501 18:09:44
    20110909 20:02:42
    20130408 18:09:03
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1033345]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-03-28 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found