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: <d8e13286-e58d-5eec-7080-40941603ddd3@redhat.com> (raw)
In-Reply-To: <60d27734-5ce7-6e25-e170-a0baa5442a69@redhat.com>


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

  reply	other threads:[~2016-08-31 14:46 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
2016-08-31 15:23       ` Eric Blake [this message]
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=d8e13286-e58d-5eec-7080-40941603ddd3@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).