Subject: Re: strftime %X control: how?
To: None <tech-userlevel@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-userlevel
Date: 07/05/2007 23:52:13
On Thu, 05 Jul 2007, der Mouse wrote:
> 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
> present?

Chasing the source code suggests that you could create a binary
file in the undocumented format expected by __loadtime() in
src/libc/locale/timeio.c, store that file somewhere under
/usr/share/locale, and set LC_TIME to a value that would cause
load_locale_sub() in src/lib/libc/setlocale.c to pass the file name to
__loadtime().

Hmm, the relevant code is only in -current, not even in the netbsd-4
branch.  And the file format is documented in PR 10877, though not
anywhere in the base system.

--apb (Alan Barrett)