This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Request locale for ISO 8601 date.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]