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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=yce8hLSqoAlR2PrXFov/4xIB5Ieq2R8xyjlOqVSY8G5pZuFL+K4lt 9Q1urla1og7l0rAipB+qL0hrB8X/Y6rWlQmoGEuH0y99Q731ZEhKoQfquf4fzR7f DDPIkHjmNEEsRiVfdHoP/Yd0K3X6W6rIEK29wnYj0YGTcNvGIJeQjQ= 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:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=OPz8kJrXrXLiYphiDmreGz4dN8U=; b=RQjAqmGyxR2nzP2JHfo1334jli0s mdZBAzvMTrtOmjtUg3tIuffn97xG5owW3tdrVWAuIYH8MLhg5EXeufFIY/XOxZVr /2r9qOb11U2ihC2HjU7qACcUxbjoVbQjDstK7Q2rmXxaZJU+Rhe6Z7SUCgwfs6gb gf0Boqb0jEc+fVA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-101.5 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Region, Panel, intuitively, Formats X-HELO: drew.franken.de Date: Wed, 31 Aug 2016 17:52:22 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Different representations of time in ls -l and date(1) Message-ID: <20160831155222.GE22389@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KN5l+BnMqAQyZLvT" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.2 (2016-07-01) --KN5l+BnMqAQyZLvT Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=3DC), 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). > >=20 > > Still further investigation shows that on SUSE Linux, with > > LANG=3Den_US.UTF-8, both of these utilities consistently, if counter- > > intuitively, display 24 hour time. > >=20 > > So I think the problem lies in Cygwin's locale database. >=20 > [Cygwin's locale database is Windows' locale database] >=20 > 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 >=20 > This is the standard English (United States) setting. > 24 hour format is represented in Windows by either H:mm or HH:mm. >=20 > 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 --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --KN5l+BnMqAQyZLvT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXxv02AAoJEPU2Bp2uRE+g+GUP/0uc34xzmrk2nKz0+6BJLPdD HOsnQJw+vyAzn7R7zaUYIRFakYVeUH3kZlx6PYQVzieFxNSrnGOHVhnEbB3ffikx yQCYPWF6ttH844f62okPO5nLAEKGNHpS8H6nf4wyyqiTIMRVMqoqRTcHtpufH45c j2/rp4g6cl0si3isCcBzvgqTUIuF/XKl2+XR+viSfOOxZNamUJJNOShA/8wRwvVa FDuXjk18P6ZDkv3gcznmVY3MotCcATMQFkUWJcvEKz1ejgTB6Fu+iY/ZeIOOciND xu99NWPl0LqnlroG5sz5U3nvnvZzhz+5EuEQFwvabgXMDbMn7TdO6jaGCwlyuTyB fyHT1mEU0XIKCwoVQ5s5iaTgGBX7CynsulOZdnn/k9lJPnJz4DFs/64wu73y7lae 8+mCDi5Mk7sRibGxyJCvVcvM+S3QxX+Rk1du4p4MunlEcWMsoheLRnaY8yu8J2AJ 2R4JRC/4Elv8paDUv2nR1IaMlFJ/rhhmLqnI0KB0NPMPDuSXgtNGsWfdCxZQDgGb so5nUjkAI6hkWl4myninY8dr0bTWb8gAblpR+aOwoME4faKuvKshLxaZOS50g/ce cTvKElLYVe3xGu695yjBWJUbRBDq/N+oMOtFGBsRMmRhtwdn57k/bTf0GQgDeuD2 C2wFmPBLm7hZ2BXxu7LP =9J8n -----END PGP SIGNATURE----- --KN5l+BnMqAQyZLvT--