Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Custom date string formatting

by izut (Chaplain)
on Jan 31, 2007 at 21:14 UTC ( [id://597638]=note: print w/replies, xml ) Need Help??


in reply to Custom date string formatting

Hi nelio.

You really should follow Limbic~Region's tip, by using POSIX' strftime, which is bundled with Perl or DateTime.

I would also to add another alternative (which you should not use in production environment):

sub format_date { return join ".", (reverse unpack "A4xA2xA2", shift); }

Update: I think it is ok use this if you know what are you doing and you will not perform any date calculation with it.

Igor 'izut' Sutton
your code, your rules.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-24 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found