delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/08/31/11:24:04

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=ync
xnEoP1VxAjMVKMhSjIM9M2IiSgvwyPl1/rzPursmLrDY5h9cKVsWE6SD1waQNo6U
6gvjhqIAzGP31vrV1ngma1Ss42Nd+o2FMxrSFbkeKIOYSBAQPThMgvtulGcSstK8
OjeOc6QDALhmStW7HWYScVherKjdHoqv+j8nXNnM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; s=default; bh=TLbnqtB1W
dZb9OoBykl+I6yYPIU=; b=Pa5boGFTfWuZ5adn2332YRZT1HYRAx5lIEOdTRVA4
NiVWaO3r4SvjwS3t3TJZcwPmt/tEoPKV4N2jup//AYA7xyZ79NjW8siTziwIHXI1
xtr0ua+nNzswi2nAWjXcvZ2rMHB7qorqYwQJGqw9jXRWRmTuz/Q76vbSwmkldVXL
M8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=3.8 required=5.0 tests=AWL,BAYES_60,KAM_LAZY_DOMAIN_SECURITY,KAM_STOCKGEN autolearn=no version=3.3.2 spammy=Region, Panel, HContent-Language:de-DE, H*r:169.254.2
X-HELO: thoth.sbs.de
From: "Schwarz, Konrad" <konrad DOT schwarz AT siemens DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: Different representations of time in ls -l and date(1)
Date: Wed, 31 Aug 2016 15:23:37 +0000
Message-ID: <A45B1767F1002449A37508C2CC6003D736A379@DEFTHW99EJ1MSX.ww902.siemens.net>
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u7VFO0Nk029774

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019