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

Re: Want to format date and time

by space_monk (Chaplain)
on Nov 17, 2012 at 22:50 UTC ( #1004356=note: print w/ replies, xml ) Need Help??


in reply to Want to format date and time

Well the current local time is returned by localtime

Formatting that time can be done in many different ways in Perl. The quickest way is probably to use the Posix strftime function.

Putting the two together gives:

use POSIX; print strftime( "%d/%y/%Y", localtime());
A Monk aims to give answers to those who have none, and to learn from those who know more.


Comment on Re: Want to format date and time
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2014-09-20 16:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls