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 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
* 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

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).