in reply to Re^2: Local Date Format
in thread Local Date Format

How portable do you need this to be? On unix, this oughta work, but is dirty:

my $date_fmt = grep s/^date_fmt="(.*)"$/$1/, `locale -k LC_TIME`;

You could do this in c (one hopes) on any POSIX system — possibly inlining it in Perl with Inline::C — with the setlocale() function; make the second paramater NULL to query the current locale.

Replies are listed 'Best First'.
Re^4: Local Date Format
by SmokeyB (Scribe) on Feb 22, 2005 at 18:37 UTC
    Thanks gaal, this is a good start and I'll definately be exploring it!