Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: date

by demerphq (Chancellor)
on Feb 13, 2002 at 09:38 UTC ( [id://145116]=note: print w/replies, xml ) Need Help??


in reply to Year shows as 20102 in date

use POSIX; print POSIX::strftime( "%Y/%m/%d", localtime());

Yves / DeMerphq
--
When to use Prototypes?

Replies are listed 'Best First'.
Re: Re: date
by count0 (Friar) on Feb 13, 2002 at 16:55 UTC
    For those that are a bit uneasy with using POSIX, Date::Format has a compatible strftime().

    I'm not quite sure what little is on about below, with other languages, and Apache... =/
    But Date::Format (or POSIX::strftime) is definitely what you're looking for.

      Date::Format allows to say as an Option for example 'german'

      Date::Format->language('German');

      which causes a format of like "%A, den %d. %B %Y" to display as 'Mittwoch, den 13. Februar 2002'
      And thats just noted in the POD. So simply change this option to english and you get the date in english, ok, there you need to provide a different Format though. But could it be any easier than this?

      Have a nice day
      All decision is left to your taste

Log In?
Username:
Password:

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

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

    No recent polls found