X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Thu, 1 Sep 2011 20:40:56 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Request locale for ISO 8601 date.
Message-ID: <20110901184056.GB22172@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <j3oeps$gcv$1@dough.gmane.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <j3oeps$gcv$1@dough.gmane.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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

