* Request locale for ISO 8601 date.
@ 2011-09-01 17:19 Oleksandr Gavenko
2011-09-01 18:41 ` Corinna Vinschen
0 siblings, 1 reply; 2+ messages in thread
From: Oleksandr Gavenko @ 2011-09-01 17:19 UTC (permalink / raw)
To: cygwin
$ 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.
It is possible install locale to get ISO 8601 date formatting?
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Request locale for ISO 8601 date.
2011-09-01 17:19 Request locale for ISO 8601 date Oleksandr Gavenko
@ 2011-09-01 18:41 ` Corinna Vinschen
0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2011-09-01 18:41 UTC (permalink / raw)
To: cygwin
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-01 18:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-01 17:19 Request locale for ISO 8601 date Oleksandr Gavenko
2011-09-01 18:41 ` Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).