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

Re: munging the date for various uses

by chanio (Priest)
on Oct 06, 2005 at 04:34 UTC ( #497807=note: print w/ replies, xml ) Need Help??


in reply to munging the date for various uses

Good!

If you use POSIX::strftime you could improve your sub by accepting some integer value:

  • * If you don't receive any value or you receive 0 you would return your format.
  • * If 1, the LINUX format: yymmddhhmmss (I guess).
  • * Another format might be the MySQL one.
  • * Another one, the short format mm/dd/yy hh:mm:ss
  • * Then, the long one mmm,dd yyyy hh:mm:ss tz
  • * Create others
The more possible outputs you could add, the more useful sub it would become. Perhaps, having your own module of useful subs to load with every code you write...


Comment on Re: munging the date for various uses

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-08-29 04:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls