You are not logged in.

#1 2010-06-06 07:10:53

thetrivialstuff
Member
Registered: 2006-05-10
Posts: 191

date formats, locale files, and how to change them?

I'm not sure this is the right category, but I feel like a newbie asking this question: I want my default date format to be ISO 8601 (yyyy-mm-dd). Specifically, and somewhat embarrassingly, I want to do this system-wide because of this insanity:

http://www.openoffice.org/issues/show_bug.cgi?id=5556

...which has finally driven me to the brink of drinking. Or something.

Anyway, I got as far as /usr/share/i18n/locales, but how the heck do I edit something like this?:

date_fmt    "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
<U0025><U005A><U0020><U0025><U0059>"

Those look like the hex codes for unicode characters for date formats (U0025 is %, so I'm guessing it's a unicode-ification of something like the %d %m %Y we'd see elsewhere), but escaped really funny. Is there some nice, easy utility out there for either converting this back into readable text? Or (am I asking too much here?) is there something like the Regional Settings control panel in Windows? 'Cause one good thing I'll say about Windows; it made it damned easy to get my dates into whatever format I felt like using.

If that's asking too much, does anyone know which flavour of English has 8601 date formats? I'd rather not switch to Hungarian if I can avoid it (I'm told it has ISO 8601 dates, but I don't speak Hungarian, so that's not very convenient)...

~Felix.

Offline

#2 2010-06-06 07:52:41

kazuo
Member
From: São Paulo/Brazil
Registered: 2008-03-18
Posts: 413
Website

Re: date formats, locale files, and how to change them?

Two part anwser, first you can set only LC_TIME to something else, more appropriated like hungarian or anything, the locale settings are divided in variuos parts (using locale without any option give the values)

EDIT ops, forge. And about converting (I dont think you gonna need, but...)

from uni to human

python -c "import sys;print''.join([unichr(int(i,16))for i in sys.argv[1].replace('<U','').split('>')[:-1]])" '<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U0020><U0025><U0059>'

from human to uni

python -c 'import sys;print "".join(["<U%04x>" % ord(unicode(i)) for i in sys.argv[1]])' '%a %b %e %H:%M:%S %Z %Y'

EDIT. Googled for "iso 8601 locale" and I get this http://myy.helia.fi/~karte/internationa … rbird.html , looks like what you really want.

Last edited by kazuo (2010-06-06 08:13:54)

Offline

#3 2010-06-06 08:12:59

thetrivialstuff
Member
Registered: 2006-05-10
Posts: 191

Re: date formats, locale files, and how to change them?

Thanks for the python code -- and actually, due to another bug in OpenOffice, it doesn't use LC_TIME (http://www.openoffice.org/issues/show_bug.cgi?id=102517).

I think it might even have its own built in copies of the locales; I just edited date_fmt in en_GB and other programs obey the change, but openoffice doesn't.

~Felix.

Offline

#4 2010-06-06 08:24:38

kazuo
Member
From: São Paulo/Brazil
Registered: 2008-03-18
Posts: 413
Website

Re: date formats, locale files, and how to change them?

Huhaha, this bug report made my day...

So issues for non-Windows users are features, not bugs?

Sorry to laugh at your problems... but oo.org is fuck**, What You See Is Not What You Want....

Well, I think the solution now is at level of patching code...

Offline

#5 2010-06-06 08:27:18

thetrivialstuff
Member
Registered: 2006-05-10
Posts: 191

Re: date formats, locale files, and how to change them?

kazuo wrote:

Well, I think the solution now is at level of patching code...

Yeah, it's starting to look that way. I just threw some votes at the OO bug report, but it looks like OO has its own internal copy of the locale files (why would a program do that? Isn't that a really broken thing to do?).

Any chance we could make some patches part of the build process for the Arch package? smile

~Felix.

Offline

Board footer

Powered by FluxBB