Re: Show me locale fomats
On Tue, Jun 23, 2009 at 07:24:54PM +0300, Dotan Cohen wrote:
> > 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 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?
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_GB@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.
Reply to: