X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Thu, 1 Sep 2011 20:40:56 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Request locale for ISO 8601 date. Message-ID: <20110901184056.GB22172@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: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Sep 1 20:18, Oleksandr Gavenko wrote: > $ for l in `locale -a`; do echo $l `LC_TIME=$l date`; done | tee .dat > $ grep -E '[[:digit:]]+-[[:digit:]]+-[[:digit:]]+ > +[[:digit:]]+:[[:digit:]]+:[[:digit:]]+' <.dat > sq_AL 2011-09-01 8:14:09.MD > sq_AL.utf8 2011-09-01 8:14:09.MD > > but this is not ISO 8601 as '.MD' component present... > > Usually 'LC_TIME' set to 'en_DK' to get ISO 8601 time format > but Cygwin miss this locale. Cygwin provides all locales supported by the underlying Windows system. Windows doesn't know en_DK. Linux (better: glibc) supports en_DK, but what you say doesn't work for me on Linux either: $ LC_TIME=en_DK date Thu Sep 1 20:30:01 CEST 2011 No ISO 8601 representation. > It is possible install locale to get ISO 8601 date formatting? There is no such locale. I tried your above grep on the Linux locales (on F15, glibc 2.14), too, and there isn't even one which has ISO 8601 date/time by default. If you want that date format, you have to enforce it on a per-command base, for instance: $ date +'%F %T' $ ls -l --time-style=long-iso $ ls -l --time-style='+%F %T' Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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