public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: cygwin@cygwin.com
Subject: Re: Different representations of time in ls -l and date(1)
Date: Wed, 31 Aug 2016 15:23:00 -0000	[thread overview]
Message-ID: <60d27734-5ce7-6e25-e170-a0baa5442a69@redhat.com> (raw)
In-Reply-To: <dcd35b85-cfff-a821-a81c-b311db1bd242@farance.com>


[-- 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 --]

  reply	other threads:[~2016-08-31 14:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 12:31 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60d27734-5ce7-6e25-e170-a0baa5442a69@redhat.com \
    --to=eblake@redhat.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).