Different representations of time in ls -l and date(1)
Wed Aug 31 15:23:00 GMT 2016
On 08/31/2016 09:36 AM, Eric Blake wrote:
> Not necessarily. ls hardcodes its default representation for files
> younger than 6 months to:
> "%b %e %H:%M"
> while date hardcodes its default representation to:
Except that I just tested, and nl_langinfo(_DATE_FMT) for both Cygwin
and Linux is
%a %b %e %H:%M:%S %Z %Y
so something else weird is going on.
Oh duh, it's locales! nl_langinfo() is locale-specific, and you are
(probably) running in a default locale of en_US rather than the C locale.
Wed, Aug 31, 2016 9:39:55 AM
Wed Aug 31 09:43:42 CDT 2016
So, the answer to your question is determined by what your locale thinks
is the appropriate representation; and I have no control over whether
Windows' locale defaults will match glibc's locale defaults for en_US or
any other locale outside of C.
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 604 bytes
Desc: OpenPGP digital signature
More information about the Cygwin