Thanks!
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
by issuing the locale command.
Cheers
Oli
I mean, let's say that I want yyyy-mm-dd date format? What command can
I give to show me which locale I must configure to get that format?
Sorry for not asking a clear question.
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
Normally you don't need to know. You use strptime(3) to print the
date and/or time. For example, strptime("%c", ...). The manual
page will give you the detail.
To get the format string, do:
locale -k d_fmt
d_fmt="%d/%m/%y"
(en_GB)
A list of keywords is found in locale(5).
(I don't know how to get this from within a program using a C
library interface. Does anyone else have any ideas?)
Regards,
Roger
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
I see, thanks. Other than changing my locale to a foreign locale
(well, ok, US is a foreign locale for me but there is a reason that I
keep it), is there a way to configure yyyy-mm-dd date format?
Thanks!
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
Appears to be just calling nl_langinfo(3).
Well, it depends on what you want to do. If you're using a desktop
environment like KDE, they may offer a way to customise this for just
you. However, this will only affect KDE applications which use this
configuration.
You can generate a custom locale. So instead of en_GB.UTF-8, I could
create en...@custdate.UTF-8. Do do this, you'll need to look at the
locales package and localedef. This will be available system-wide.
Once you have generated your custom locale, you can just choose it
like any other either with the LANG/LC_* environment variables or
in the desktop environment.
Note that if you only want to customise the date for the locale, just
set LC_TIME=en_GB or whatever you like. The rest of the locale will
remain the same; only date/time formatting is changed.
Regards,
Roger
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
[...]
> > I see, thanks. Other than changing my locale to a foreign locale
> > (well, ok, US is a foreign locale for me but there is a reason that I
> > keep it), is there a way to configure yyyy-mm-dd date format?
[...]
> Note that if you only want to customise the date for the locale, just
> set LC_TIME=en_GB or whatever you like. The rest of the locale will
> remain the same; only date/time formatting is changed.
To find out which locales on your system have the yyyy-mm-dd date
format, run:
grep ^d_fmt /usr/share/i18n/locales/* | ascii2uni -qaA | grep '%Y-%m-%d'
(ascii2uni is part of the uni2ascii package)
--
Regards, | http://users.icfo.es/Florian.Kulzer
Florian |
Set English in Denmark (en_DK.UTF-8) as your LC_TIME.
Obviously something like jp_JP would also do it, but then
you would get Japanese month names, etc.
Cheers,
Kelly Clowers
Please read:
http://www.debian.org/doc/manuals/debian-reference/ch09.en.html#_customized_display_of_time_and_date
http://www.debian.org/doc/manuals/debian-reference/ch01.en.html#_lang_variable
http://www.debian.org/doc/manuals/debian-reference/ch08.en.html
Good luck,
Osamu
Thank you, Osamu. While I am one of the few people who actually
appreciate being RTFMed, in this case the fine manual jsut did not
state what I needed. I will admit, however, that I do spend more time
googling nowadays rather than going right to the manual.
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il