[Solved] Changing the default date format for my locale

Archived topics about LMDE 1 and LMDE 2
Locked
Brian49

[Solved] Changing the default date format for my locale

Post by Brian49 »

Would some kind person please advise me how to change the default date format for my locale (en_GB.UTF-8)?

At the moment it is like this:

Fri Jan 6 2012

I would like it to be like this:

Fri 6 Jan 2012

I am running LMDE Xfce, where there appears to be no GUI dialog for making such a change. So far I have also been unable to find the appropriate file to edit.

Many thanks
Last edited by Brian49 on Sat Jan 07, 2012 3:08 pm, edited 1 time in total.
User avatar
xenopeek
Level 25
Level 25
Posts: 29505
Joined: Wed Jul 06, 2011 3:58 am

Re: Changing the default date format for my locale

Post by xenopeek »

You can change your locale for dates, if you know of another locale that does match the date format you want.

But for which applications do you want to change the date format? For example, for Open/Libre Office you have to configure this manually anyway as it ignores your locale. And for the clock you can set the format yourself.

I'd be happy to help if you can narrow it down a little more :wink:
Image
Brian49

Re: Changing the default date format for my locale

Post by Brian49 »

Thanks for responding.

I'm not really looking for per-application settings, although I first noticed the issue with my mail client (Claws); I set it to follow the locale default and it came out as I've described above. I don't use Libre Office.

Is there a quick way of finding out which other locales match my preferred format, please? And please remind me how to make such a change; I know there's a file somewhere with a list of locale-related variables, but I've lost track of it. Thanks again.
User avatar
xenopeek
Level 25
Level 25
Posts: 29505
Joined: Wed Jul 06, 2011 3:58 am

Re: Changing the default date format for my locale

Post by xenopeek »

I'm using Linux Mint 11, so it might be a little different for LMDE--please check the files I mention exist before you edit them, else the correct path must be different on LMDE. Anyway, you can edit /etc/default/locale (gksudo gedit /etc/default/locale) and set what locale to use for time (and dates). For example, adding the line:

Code: Select all

LC_TIME="en_GB.UTF-8"
Check with the following command what locales you have installed on your system:

Code: Select all

locale -a
You can add locales to our system in the file /var/lib/locales/supported.d/local and them running sudo dpkg-reconfigure locales.

You would have to take one of the English language locales (else Fri and Jan would be displayed in another language...), perhaps there is some where day of month and month name are reversed in order. Don't know :( Not sure how else to change this either, except to configure the date format (order) in an application itself.
Image
secipolla

Re: Changing the default date format for my locale

Post by secipolla »

Try this

Code: Select all

# date --set= '+%a %d %b %Y'
Brian49

Re: Changing the default date format for my locale

Post by Brian49 »

Vincent - Thanks very much. I will follow up your suggestions.

Secipolla - Thanks for your suggestion. The command appears to have been accepted, but I can't see any change anywhere on my system, even after rebooting.
secipolla

Re: Changing the default date format for my locale

Post by secipolla »

Can't you change the default date time in Claws mail itself? The usual strings you can find in 'man strftime'.
For the format you asked it's '%a %d %b %Y'
Brian49

Re: Changing the default date format for my locale

Post by Brian49 »

secipolla wrote:Can't you change the default date time in Claws mail itself?
Yes, of course. It's just that I would have preferred to make it system-wide.
Virtuamaker

Re: [Solved] Changing the default date format for my locale

Post by Virtuamaker »

I have just joined the Linux world today after many years of dithering. I have been building Windows PCs for 20 years and decided to take the plunge. So I built a new PC and installed Linux Mint 14.1 with Cinnamon. Not being American, I naturally wanted to change my universal Date Format to the logical day-month-year sequence with which I have been brought up and use all the time. The system tray annoyingly shows the date in the alien format, so I pottered around the interface but could not find any setting in Date Preferences. So I came to this Forum through a websearch. Being a newbie, all the Code stuff here is as yet beyond me. But this problem is marked [Solved] and the only other hint I can gather is to go round changing date settings on every application. I am frankly incredulous. I was of course aware of the horror stories of Terminal and the geeky coding image of Linux, and I knew I would have to get my hands dirty at some future stage. But on the first day? Is this really the best that the Linux system can offer to a newbie???
User avatar
xenopeek
Level 25
Level 25
Posts: 29505
Joined: Wed Jul 06, 2011 3:58 am

Re: [Solved] Changing the default date format for my locale

Post by xenopeek »

You responded to a topic in the Linux Mint Debian Edition section, which is arguably less suitable for newbies. Please create a topic of your own in the Main Edition section of the forum to receive support on a question you have. This topic is over a year old; kindly do not respond topics older than 6 months. See the forum rules.

Locked.
Image
Locked

Return to “LMDE Archive”