Subject: Re: strftime %X control: how?
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Greg A. Woods <firstname.lastname@example.org>
Date: 07/05/2007 17:28:38
Content-Type: text/plain; charset=US-ASCII
At Thu, 5 Jul 2007 14:03:21 -0400 (EDT), der Mouse wrote:
Subject: strftime %X control: how?
> Normally I run with nothing locale-specific in my environment, which I
> think means I get the C locale.
> But this means that atq prints dates as xx/xx/xx, which is horrible. I
> want standard ISO date format, but I otherwise want what I have now.
> My question is, how can I get this?
I don't think you can, yet. From setlocale(3)'s BUGS in everything up
to at least netbsd-4:
The current implementation supports only the "C" and "POSIX"
locales for all but the LC_CTYPE locale.
Indeed the code for setlocale(3) in netbsd-4 shows that nothing is done
for LC_TIME, and there are no specifications for LC_TIME features in
> After a little digging, it appears to me that I need to set $LC_TIME,
> but I haven't found any clue what to set it to. Am I missing
> something, or is there just no way to get standard dates out of %X at
Further noted in setlocale(3):
LC_NUMERIC and LC_TIME are personal choices and should
not be wrapped up with the other categories.
at The at and cron family of utilities were omitted because
portable applications could not rely on their behavior.
however the Single UNIX Specification v2 documents "at -l" as using
LC_TIME to "determine the format and contest for date and time strings
Personally I don't think it should be possible to personalize the date
formats used in standard reports produced by command-line tools. They
should always be in the most appropriate standard format regardless of
locale. E.g. strftime("%F-%T%z");
Greg A. Woods
H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <email@example.com>
Planix, Inc. <firstname.lastname@example.org> Secrets of the Weird <email@example.com>
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
-----END PGP SIGNATURE-----