Subject: Re: strftime %X control: how?
To: None <>
From: Brian Ginsbach <>
List: tech-userlevel
Date: 07/06/2007 14:29:10
On Thu, Jul 05, 2007 at 11:52:13PM +0200, Alan Barrett wrote:
> 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.

I've started working on creating the files to populate /usr/share/locale.
I just don't seem to have enough roundtoits...

I've been basing my work on some of FreeBSD's LC_TIME data.  I'm just
not sure that I completely trust it.  Some of it doesn't seem to jibe.

Does anyone know if there is a definitive source for the required
LC_TIME data: short weekday names, long weekday names, short month
names, long month names, ante-meridiem/post-meridiem, date and
time (%c), date (%x), Time (%X), and 12 hour clock?