LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
 
Search this Thread
Old 07-27-2005, 11:33 PM   #1
candyman123
Member
 
Registered: Jul 2003
Posts: 46

Rep: Reputation: 15
Date Format and Locale


The date in Thunderbird and other programs is taken from the system.

My system shows the date as:

05/23/05
MM/DD/YY

In windows, this is simple as pie to change.

In linux, I don't have a clue and I failed on google (or didn't try hard enough).

I want my date to be as follows:

2005.05.23

Thanks.
 
Old 07-28-2005, 12:20 AM   #2
king111
Member
 
Registered: Jul 2005
Distribution: Debian, Ubuntu
Posts: 85

Rep: Reputation: 15
man date

Why do you want your date to be months into the past? That's going to cause problems.
 
Old 08-13-2005, 09:05 AM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
If I understand your question correctly, you don't want to actually change the date, just the the format it's displayed in.

If I am correct that you want it as YYYY.MM.DD, you are selecting a super logical Japanese style format where everything flows from most significant to least significant -- just like currency or other human readable numbers. A complete time stamp might be: YYYY.MM.DD HH:MM:SS.ssss (where HH is in the 24-hour clock style).

By mentioning "Winders", you imply you are using one of the two desktop environments (as opposed to just a window manager or the command line). Unfortunately, I don't think date is going to be of any use here.

In KDE, right clicking on the clock display will bring up a menu that includes a Date & Time Format. Its dialog box has a Time & Dates tab... You can make up your own format, the Help button will explain the formating codes.
 
Old 11-21-2005, 09:43 PM   #4
BlueSloth
LQ Newbie
 
Registered: Sep 2005
Distribution: Debian sid
Posts: 9

Rep: Reputation: 0
I don't have KDE. Is there a way to do this that's not dependent on having a particular window manager or desktop environment? I would guess it'd involve setting LC_TIME in a boot script, but I don't know what to set it to. I want the ISO 8601 date and time format (YYYY-MM-DD hh:mm:ss). Any ideas?

BlueSloth
 
Old 11-24-2005, 07:01 AM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
Locale customization references

candyman123 -- I hope your Q is answered / problem is solved. BTW, how did it turn out?


BlueSloth
You raise a new, but related, interesting problem. I think your answer is here:
Quote:
I believe this should be possible by changing the locale
definition for LC_TIME in /usr/share/i18n/locales/en_US and
re-compilng the locale with localeconv. See "man 5 locale" and
"man localeconv".
--
Markku Kolkka
https://www.redhat.com/archives/fedo.../msg02900.html
Here are some hints & references:
The "man COMMAND" lines will work at the command prompt, the "man:COMMAND" lines will work in Konqueror (using the "man" kioslave) -- triple-click, ^C, ^T, ^V,<enter> -- they are included for those of us who do have (& use) KDE. Again, for those of you who with KDE -- If you use Konqueror & the KDE man ioslave, you will get 3 benefits: HTML presentation, actual links in many of the pages, & the command set is local to your distro.
Otherwise -- With the LQ man pages, you get HTML & the links, but not necessarily the localization.
Finally -- The command line gives localization, but no links & no HTML.


Consider creating a new, personal, locale -- rather than editing an existing standard one. Needless to say, don't forget to back up the original if you go the editing route. If you go the create route, pay attention to the copy keyword in locale(5).

Without knowing anything about VectorLinux, I can't be much more specific.

Please let us know what you do & how it works.
 
Old 11-29-2005, 02:05 PM   #6
BlueSloth
LQ Newbie
 
Registered: Sep 2005
Distribution: Debian sid
Posts: 9

Rep: Reputation: 0
YAY!

That was harder than I expected, but I did it. I made my own locale (en_US@bs) with everything but the LC_TIME section copyed from en_US. The en_US source file has has a lot of stuff in it that looks like
Code:
<U0074><U0068><U0069><U0073><U0020><U004F><U002E><U004F>
I wanted to make my locale the same way, because as far as I know doing it any other way might have unforseen consequences. So I made a little Mathematica program to convert between plain text and the <U0020> stuff.

It took me a while to figure out that the locale in VectorLinux is set by editing /etc/profile.d/lang.sh and /etc/profile.d/lang.csh, but I eventually got it and my new locale is working just like I expected.

BlueSloth
 
Old 12-05-2005, 03:42 PM   #7
BlueSloth
LQ Newbie
 
Registered: Sep 2005
Distribution: Debian sid
Posts: 9

Rep: Reputation: 0
Oops. I spoke too soon. Now when I start most GUI programs I either get
Code:
locale not supported by Xlib, locale set to C
or something like
Code:
(emelfm2:5073): Gdk-WARNING **: locale not supported by Xlib

(emelfm2:5073): Gdk-WARNING **: cannot set locale modifiers
I compiled my locale with the ISO-8859-1 charset, so I added "en_US@bs en_US.ISO8859-1" to every locale.alias file I could find. I don't know what else to do.

The programs that produce the warnings still work ok, and they even use the new locale's date format like I wanted. So I guess if nobody can figure this out I can just try to ignore the warnings

BTW, soon after I made my new locale I reinstalled Xorg to fix an unrelated problem. The unrelated problem is now fixed, but the "locale not supported" problem remained unaffected.

BlueSloth
 
Old 01-03-2006, 11:58 PM   #8
BlueSloth
LQ Newbie
 
Registered: Sep 2005
Distribution: Debian sid
Posts: 9

Rep: Reputation: 0
I fixed it!

I found the part of the /etc/profile.d/lang.sh and lang.csh files where I'd put
Code:
export LANG=en_US@bs
and changed it to:
Code:
export LANG=en_US
export LC_TIME=en_US@bs

BlueSloth
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'date' command format Neorio Linux - General 3 01-18-2011 05:18 AM
Need workaround for Date Format Cyberdyne Slackware 2 07-22-2005 04:36 AM
Date format Mik LQ Suggestions & Feedback 8 12-05-2004 10:14 AM
MySQL date format mnauta Linux - General 2 05-13-2004 06:20 PM
All I want to do is change the date format... Slycordinator Linux - General 5 12-11-2003 01:27 AM


All times are GMT -5. The time now is 11:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration