public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Different representations of time in ls -l and date(1)
@ 2016-08-31 12:31 Schwarz, Konrad
  2016-08-31 13:04 ` Markus Hoenicka
  0 siblings, 1 reply; 14+ messages in thread
From: Schwarz, Konrad @ 2016-08-31 12:31 UTC (permalink / raw)
  To: cygwin

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?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Different representations of time in ls -l and date(1)
  2016-08-31 12:31 Different representations of time in ls -l and date(1) Schwarz, Konrad
@ 2016-08-31 13:04 ` Markus Hoenicka
  2016-08-31 14:23   ` Marco Atzeri
  2016-08-31 14:37   ` Frank Farance
  0 siblings, 2 replies; 14+ messages in thread
From: Markus Hoenicka @ 2016-08-31 13:04 UTC (permalink / raw)
  To: cygwin

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?
> 
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

date has a ton of options to format the output including the 12/24 h 
style, , see 'man date'.

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Different representations of time in ls -l and date(1)
  2016-08-31 13:04 ` Markus Hoenicka
@ 2016-08-31 14:23   ` Marco Atzeri
  2016-08-31 14:37   ` Frank Farance
  1 sibling, 0 replies; 14+ messages in thread
From: Marco Atzeri @ 2016-08-31 14:23 UTC (permalink / raw)
  To: cygwin

On 31/08/2016 14: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?
>>

>
> date has a ton of options to format the output including the 12/24 h
> style, , see 'man date'.
>
> regards,
> Markus
>

same for ls.

Regards
Marco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Different representations of time in ls -l and date(1)
  2016-08-31 13:04 ` Markus Hoenicka
  2016-08-31 14:23   ` Marco Atzeri
@ 2016-08-31 14:37   ` Frank Farance
  2016-08-31 15:23     ` Eric Blake
  2016-08-31 15:52     ` Brian Inglis
  1 sibling, 2 replies; 14+ messages in thread
From: Frank Farance @ 2016-08-31 14:37 UTC (permalink / raw)
  To: cygwin

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?
>>
>> --
>> Problem reports:       http://cygwin.com/problems.html
>> FAQ:                   http://cygwin.com/faq/
>> Documentation:         http://cygwin.com/docs.html
>> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
> date has a ton of options to format the output including the 12/24 h style, ,
> see 'man date'.
>
> regards,
> Markus
>


Markus and Marco-

You have misunderstood the question.

Question Intended: Why are they different?
Incorrectly Interpreted: There are lots of options for "ls" and "date".

I have everything in 24-hour format, yet my LC_TIME and LANG are the same as Konrad.

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.

-FF

-- 
______________________________________________________________________
Frank Farance, Farance Inc.    T: +1 212 486 4700   M: +1 917 751 2900
mailto:frank@farance.com       http://farance.com
Standards/Products/Services for Information/Communication Technologies

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Different representations of time in ls -l and date(1)
  2016-08-31 14:37   ` Frank Farance
@ 2016-08-31 15:23     ` Eric Blake
  2016-08-31 15:23       ` Eric Blake
  2016-08-31 15:51       ` Corinna Vinschen
  2016-08-31 15:52     ` Brian Inglis
  1 sibling, 2 replies; 14+ messages in thread
From: Eric Blake @ 2016-08-31 15:23 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 1320 bytes --]

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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Different representations of time in ls -l and date(1)
  2016-08-31 15:23     ` Eric Blake
@ 2016-08-31 15:23       ` Eric Blake
  2016-08-31 16:42         ` Erik Soderquist
  2016-08-31 15:51       ` Corinna Vinschen
  1 sibling, 1 reply; 14+ messages in thread
From: Eric Blake @ 2016-08-31 15:23 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 1007 bytes --]

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:
> 
> nl_langinfo(_DATE_FMT)
> 

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.

$ date
Wed, Aug 31, 2016  9:39:55 AM
$ LC_ALL=C
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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Different representations of time in ls -l and date(1)
  2016-08-31 15:23     ` Eric Blake
  2016-08-31 15:23       ` Eric Blake
@ 2016-08-31 15:51       ` Corinna Vinschen
  1 sibling, 0 replies; 14+ messages in thread
From: Corinna Vinschen @ 2016-08-31 15:51 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Different representations of time in ls -l and date(1)
  2016-08-31 14:37   ` Frank Farance
  2016-08-31 15:23     ` Eric Blake
@ 2016-08-31 15:52     ` Brian Inglis
  1 sibling, 0 replies; 14+ messages in thread
From: Brian Inglis @ 2016-08-31 15:52 UTC (permalink / raw)
  To: cygwin

On 2016-08-31 07:04, 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?
>> date has a ton of options to format the output including the 12/24 h style, ,
>> see 'man date'.
> You have misunderstood the question.
> Question Intended: Why are they different?
> Incorrectly Interpreted: There are lots of options for "ls" and "date".
> I have everything in 24-hour format, yet my LC_TIME and LANG are the same as Konrad.
> 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.

POSIX specifies that locale settings are used by default in date and ls.
In the case of date, that appears to be Windows regional settings long date time, with
abbreviated words, as I have no idea where else it could be getting that custom format.
In ls, I appear to be getting the POSIX default.
POSIX also says that LC_ALL overrides LC_TIME overrides LANG, so if you have LC_ALL set,
you can only override it with LC_ALL e.g. "LC_ALL=C date" to get the default format.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Different representations of time in ls -l and date(1)
  2016-08-31 15:23       ` Eric Blake
@ 2016-08-31 16:42         ` Erik Soderquist
  2016-08-31 21:11           ` cyg Simple
  0 siblings, 1 reply; 14+ messages in thread
From: Erik Soderquist @ 2016-08-31 16:42 UTC (permalink / raw)
  To: cygwin

On Wed, Aug 31, 2016 at 10:45 AM, Eric Blake wrote:
> 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.


It is because I have been burned on this (world wide customers) that I
know explicitly specify the format I want to work with in my scripts
and disregard whatever the local is.

-- Erik

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Different representations of time in ls -l and date(1)
  2016-08-31 16:42         ` Erik Soderquist
@ 2016-08-31 21:11           ` cyg Simple
  0 siblings, 0 replies; 14+ messages in thread
From: cyg Simple @ 2016-08-31 21:11 UTC (permalink / raw)
  To: cygwin

On 8/31/2016 11:23 AM, Erik Soderquist wrote:
> On Wed, Aug 31, 2016 at 10:45 AM, Eric Blake wrote:
>> 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.
> 
> 
> It is because I have been burned on this (world wide customers) that I
> know explicitly specify the format I want to work with in my scripts
> and disregard whatever the local is.
> 

In other words, don't trust a default to provide the exact
representation needed for your process to work correctly.  You cannot
control what a default might return so be specific if you have a
specific format required.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Different representations of time in ls -l and date(1)
  2016-08-31 16:28 Schwarz, Konrad
@ 2016-08-31 17:41 ` Corinna Vinschen
  0 siblings, 0 replies; 14+ messages in thread
From: Corinna Vinschen @ 2016-08-31 17:41 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2159 bytes --]

On Aug 31 15:23, Schwarz, Konrad wrote:
> > -----Original Message-----
> > > > 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?
> > >
> > > Further experimentation shows that they do indeed use the same format
> > > in the POSIX locale, (LANG=C), as required by that standard.
> > >
> > > However, I still think it is an ugly inconsistency for them to differ
> > > in the en_US.UTF-8 locale (which I assume is the default locale in
> > > Cygwin).
> > 
> > Still further investigation shows that on SUSE Linux, with
> > LANG=en_US.UTF-8, both of these utilities consistently, if counter-
> > intuitively, display 24 hour time.
> > 
> > So I think the problem lies in Cygwin's locale database.
> 
> [Cygwin's locale database is Windows' locale database]
> 
> On my Windows 7 machine, Control Panel, Region and Language, Formats shows
> Short time: h:mm tt
> Long time: h:mm:ss tt
> AM Symbol: AM
> PM Symbol: PM
> 
> This is the standard English (United States) setting.
> 24 hour format is represented in Windows by either H:mm or HH:mm.
> 
> Shouldn't ls -l therefore be using a 12 hour format?

Cygwin has a conversion routine, which converts the Windows date/time
input strings to POSIX-compatible strftime strings for digestion by
applicatrions calling nl_langinfo.

I just checked:

  Input:  "h:mm:ss tt"
  Output: "%l:%M:%S %p"

This looks pretty much like a 12hour AM?PM format to me.

If ls uses what Cygwin provides for the default time format, then it
does.  But note Eric's mail in this thread:
https://cygwin.com/ml/cygwin/2016-08/msg00630.html


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Different representations of time in ls -l and date(1)
@ 2016-08-31 16:28 Schwarz, Konrad
  2016-08-31 17:41 ` Corinna Vinschen
  0 siblings, 1 reply; 14+ messages in thread
From: Schwarz, Konrad @ 2016-08-31 16:28 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> > > 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?
> >
> > Further experimentation shows that they do indeed use the same format
> > in the POSIX locale, (LANG=C), as required by that standard.
> >
> > However, I still think it is an ugly inconsistency for them to differ
> > in the en_US.UTF-8 locale (which I assume is the default locale in
> > Cygwin).
> 
> Still further investigation shows that on SUSE Linux, with
> LANG=en_US.UTF-8, both of these utilities consistently, if counter-
> intuitively, display 24 hour time.
> 
> So I think the problem lies in Cygwin's locale database.

[Cygwin's locale database is Windows' locale database]

On my Windows 7 machine, Control Panel, Region and Language, Formats shows
Short time: h:mm tt
Long time: h:mm:ss tt
AM Symbol: AM
PM Symbol: PM

This is the standard English (United States) setting.
24 hour format is represented in Windows by either H:mm or HH:mm.

Shouldn't ls -l therefore be using a 12 hour format?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Different representations of time in ls -l and date(1)
  2016-08-31 14:48 Schwarz, Konrad
@ 2016-08-31 15:01 ` Corinna Vinschen
  0 siblings, 0 replies; 14+ messages in thread
From: Corinna Vinschen @ 2016-08-31 15:01 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1873 bytes --]

On Aug 31 14:23, Schwarz, Konrad wrote:
> > -----Original Message-----
> > From: Schwarz, Konrad (CT RDA ITP SES-DE)
> > Sent: Wednesday, August 31, 2016 2:51 PM
> > To: 'cygwin@cygwin.com'
> > Subject: RE: Different representations of time in ls -l and date(1)
> > 
> > > -----Original Message-----
> > > From: Schwarz, Konrad (CT RDA ITP SES-DE)
> > > Sent: Wednesday, August 31, 2016 1:42 PM
> > > To: 'cygwin@cygwin.com'
> > > Subject: RE: Different representations of time in ls -l and date(1)
> > >
> > > 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?
> > 
> > Further experimentation shows that they
> > do indeed use the same format in the POSIX locale, (LANG=C), as
> > required by that standard.
> > 
> > However, I still think it is an ugly inconsistency for them to differ
> > in the en_US.UTF-8 locale (which I assume is the default locale in
> > Cygwin).
> 
> Still further investigation shows that on SUSE Linux, with LANG=en_US.UTF-8,
> both of these utilities consistently, if counter-intuitively, display 24 hour time.
> 
> So I think the problem lies in Cygwin's locale database.

If so, it would be Window's locale database.  Apart from information
not available on Windows (era and messages info) all other locale
info is fetched from Windows.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: Different representations of time in ls -l and date(1)
@ 2016-08-31 14:48 Schwarz, Konrad
  2016-08-31 15:01 ` Corinna Vinschen
  0 siblings, 1 reply; 14+ messages in thread
From: Schwarz, Konrad @ 2016-08-31 14:48 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: Schwarz, Konrad (CT RDA ITP SES-DE)
> Sent: Wednesday, August 31, 2016 2:51 PM
> To: 'cygwin@cygwin.com'
> Subject: RE: Different representations of time in ls -l and date(1)
> 
> > -----Original Message-----
> > From: Schwarz, Konrad (CT RDA ITP SES-DE)
> > Sent: Wednesday, August 31, 2016 1:42 PM
> > To: 'cygwin@cygwin.com'
> > Subject: RE: Different representations of time in ls -l and date(1)
> >
> > 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?
> 
> Further experimentation shows that they
> do indeed use the same format in the POSIX locale, (LANG=C), as
> required by that standard.
> 
> However, I still think it is an ugly inconsistency for them to differ
> in the en_US.UTF-8 locale (which I assume is the default locale in
> Cygwin).

Still further investigation shows that on SUSE Linux, with LANG=en_US.UTF-8,
both of these utilities consistently, if counter-intuitively, display 24 hour time.

So I think the problem lies in Cygwin's locale database.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-08-31 20:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-31 12:31 Different representations of time in ls -l and date(1) Schwarz, Konrad
2016-08-31 13:04 ` Markus Hoenicka
2016-08-31 14:23   ` Marco Atzeri
2016-08-31 14:37   ` Frank Farance
2016-08-31 15:23     ` Eric Blake
2016-08-31 15:23       ` Eric Blake
2016-08-31 16:42         ` Erik Soderquist
2016-08-31 21:11           ` cyg Simple
2016-08-31 15:51       ` Corinna Vinschen
2016-08-31 15:52     ` Brian Inglis
2016-08-31 14:48 Schwarz, Konrad
2016-08-31 15:01 ` Corinna Vinschen
2016-08-31 16:28 Schwarz, Konrad
2016-08-31 17:41 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).