Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Month Names

by ZZamboni (Curate)
on Sep 28, 2000 at 01:09 UTC ( [id://34284]=note: print w/replies, xml ) Need Help??


in reply to Month Names

Another possibility (apart from all the other ideas here) would be to use the Date::Manip module, which can handle (both parse and produce) dates in several different languages (search in the documentation for "Language" to see the supported ones). For example:
use strict; use Date::Manip; my $d=ParseDate("today"); foreach my $l (qw(English French Swedish German Spanish Italian)) { Date_Init("Language=$l"); print "$l: ".UnixDate($d, "%F\n"); }
Which produces:
English: Wednesday, September 27, 2000 French: mercredi, septembre 27, 2000 Swedish: Onsdag, September 27, 2000 German: Mittwoch, September 27, 2000 Spanish: Miercoles, Septiembre 27, 2000 Italian: Mercoledi, Settembre 27, 2000
Note a few points:
  • I did the ParseDate before changing the language from English (the default), because otherwise I would have had to change "today" to each language in turn.
  • I couldn't find a way for it to change the format according to each language's conventions, as mentioned by ar0n.
  • If all you need are month names, Date::Manip may be overkill, because it is a very big module. But if you need dates in general, it might be worth a try.

--ZZamboni

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-18 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found