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

Re: Custom date string formatting

by izut (Chaplain)
on Jan 31, 2007 at 21:14 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2021-03-02 21:42 GMT
Find Nodes?
    Voting Booth?
    My favorite kind of desktop background is:

    Results (63 votes). Check out past polls.