[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: The output of ctime() and asctime()



In the message <[🔎] 000601c0af20$e49bbd80$0100a8c0@mshome.net> 
"Erwin Dondorp" <erwindon@wxs.nl> wrote:

> Today I spent a wasted hour looking through the glibc source code,
> to find out why the two functions ctime(3) and asctime(3) do not use
> the locale as specified by the environment variable LANG or the explicit
> function call setlocale(3). strftime(3) seems to work fine.

> Is this a bug? Then why is such an obvious bug still there...
> Or is there a good reason for this? Then please share it...

It is not a bug but a feature defined by the spec.
"The Single UNIX (R) Specification, Version 2", you can
get it from http://www.unix-systems.org/online.html, says

	       This interface is included for compatibility with older
  implementations, and does not support localised date and time formats.
  Applications should use strftime() to achieve maximum portability.

Take care,

-- 
Tetsurou



Reply to: