Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

How to get quick i nice date format?

by uksza (Canon)
on Feb 08, 2006 at 10:24 UTC ( [id://528767]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $date = `date +%Y-%m-%d_%H:%M`;
    chomp $data;
    
  2. or download this
    my ( $ss, $mm, $hh, $mday, $mon, $year, $wday, $yday, $isdst ) = 
      localtime();
    my $data = sprintf( "%d-%02d-%02d %02d:%02d",
       ( $year += 1900, $mon += 1, $mday, $hh, $mm ) );
    
  3. or download this
    use POSIX 'strftime';
    my $date = strftime '%x %X.', localtime;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-18 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found