Different representations of time in ls -l and date(1)
Corinna Vinschen
corinna-cygwin@cygwin.com
Wed Aug 31 15:51:00 GMT 2016
On Aug 31 09:36, Eric Blake wrote:
> On 08/31/2016 08:04 AM, Frank Farance wrote:
> > On 2016-08-31 08:09, Markus Hoenicka wrote:
> >> At 2016-08-31 13:41, Schwarz, Konrad was heard to say:
> >>> Sorry for the previous incomplete mail.
> >>>
> >>> So my problem is that date(1) outputs AM/PM style dates, whereas ls -l
> >>> uses 24 hour times.
> >>>
> >>> $ ls -l rtos_benchmark.lst
> >>> -rwxr-xr-x+ 1 mchn1350 Domain Users 263 Aug 31 13:14 rtos_benchmark.lst*
> >>> $ date
> >>> Wed, Aug 31, 2016 1:39:35 PM
> >>> $ echo $LC_TIME
> >>>
> >>> $ echo $LANG
> >>> en_US.UTF-8
> >>>
> >>> Shouldn't they be using the same format?
>
> 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:
>
> nl_langinfo(_DATE_FMT)
>
> >
> > Furthermore, I'd say that the default output of "date" should look like
> > the Linux one, which is the way it has looked on UNIX for about 40 years:
> >
> > Linux: Wed Aug 31 08:56:10 EDT 2016
> > Cygwin: Wed, Aug 31, 2016 08:54:49
> >
> > In other words, on Cygwin: get rid of the commas, put back the timezone.
>
> Sounds like the bug is in cygwin1.dll's nl_langinfo() function for
> returning a date format with spurious commas.
Windows LOCALE_SLONGDATE contains these commas in the en-US locale.
Outside of the "C"/"POSIX" locale the expectation of identical date/time
strings on different platforms is not feasible.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160831/4babf2ee/attachment.sig>
More information about the Cygwin
mailing list