[Perl] Multilingual date
Shlomo Yona
shlomo at siftology.com
Wed Feb 13 06:22:14 PST 2002
"Reuven M. Lerner" wrote:
>
> >>>>> Shlomo Yona writes:
>
> Shlomo> I am looking for a way to get a date in Perl, which is
> Shlomo> sensitive to the locale used. What I mean, is, if I'm with
> Shlomo> a Frech locale, I'll get the answer using French
> Shlomo> conventions, and If my locale is German, I will get the date
> Shlomo> using German conventions.
>
> Here's what it says at the bottom of "perldoc -f localtime":
>
> To get somewhat similar but locale dependent date strings, set up
> your locale environment variables appropriately (please see
> perllocale) and try for example:
>
> use POSIX qw(strftime);
> $now_string = strftime "%a %b %e %H:%M:%S %Y", localtime;
>
> Note that the %a and %b, the short forms of the day of the week
> and the month of the year, may not necessarily be three characters
> wide.
Hello.
Thanks for your answer.
I tried that. Tried that even with another locale, yet I still get the
days in English and not in the locale language.
Perhaps I'm doing something wrong?
--
Shlomo Yona.
Software Engineer.
Siftology Ltd. Israel.
Shlomo.Yona at Siftology.com
More information about the Perl
mailing list