LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices


Reply
  Search this Thread
Old 01-07-2017, 06:44 AM   #16
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480

As you can see, Linux sets up a whole string of locale-related variables so you can decouple your time, language, keyboard layout, etc. from one another.
 
1 members found this post helpful.
Old 01-07-2017, 06:58 AM   #17
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by paxolin View Post
Okey kokey, I've managed to follow that fine, thanks. Assuming you didn't want me to past the results here - or did you? It's fairly long, although I can see, if it's relevant:
#en_GB#
Great. Hazel's comment on the separation of the various locale elements is very pertinent, but in your case you want to change just one element of LC_TIME which contains the date/time formats (i.e. change / to - in the date format). So, if you were to use another locale for LC_TIME, you would have to accept all the other date-time formatting in that locale's LC_TIME, not just the date format. No other locale has LC_TIME the same as en_GB but with just the date format changed.

We have various choices as to what to do. The simplest of these is to edit the en_GB locale but only to change the specific element that you require. That is what we are going to do.

First, we need to make a copy of the existing en_GB locale in case anything goes awry. Because this file is a system file, you will need to use sudo to make the copy.

In the terminal:

cd /usr/share/i18n/locales

sudo cp en_GB en_GB%old
 
Old 01-07-2017, 07:07 AM   #18
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
Great. Hazel's comment on the separation of the various locale elements is very pertinent, but in your case you want to change just one element of LC_TIME which contains the date/time formats (i.e. change / to - in the date format). So, if you were to use another locale for LC_TIME, you would have to accept all the other date-time formatting in that locale's LC_TIME, not just the date format. No other locale has LC_TIME the same as en_GB but with just the date format changed.

We have various choices as to what to do. The simplest of these is to edit the en_GB locale but only to change the specific element that you require. That is what we are going to do.

First, we need to make a copy of the existing en_GB locale in case anything goes awry. Because this file is a system file, you will need to use sudo to make the copy.

In the terminal:

cd /usr/share/i18n/locales

sudo cp en_GB en_GB%old
Done that, and I can see by using the up arrow (same as DOS, I noticed) I could get it to repeat some previous commands and list the files in that directory. The #en_GB%old# is there.
 
Old 01-07-2017, 07:23 AM   #19
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by paxolin View Post
Done that, and I can see by using the up arrow (same as DOS, I noticed) I could get it to repeat some previous commands and list the files in that directory. The #en_GB%old# is there.
Great. Now for some editing. The default text editor in Mint 18 is xed so we will use that. Again, because it is a system file we need to edit the file as if we were a root user, not an ordinary user. Because we are going to use a GUI program, namely xed, rather than a command on the command line, we use gksudo not sudo (there are some subtle differences between gksudo and sudo which you will find explained elsewhere on the web).

gksudo xed en_GB

You will notice a red bar at the top of the editor that says "Elevated Privileges". This is there to remind you that you are editing as root, not as an ordinary user.

Don't worry that the contents of the file look a bit gobbledy-gook. Those <U0073> etc. are just a way of expressing unicode characters (see here for a list of some of them - http://www.utf8-chartable.de/).

Scroll down until you see the LC_TIME section. Then scroll down until you see the subsection called d_fmt. This is the date format, which is currently set to (translating the unicode characters) %d/%m/%y.

The forward slash is represented as <U002F>. You should see two of them on that line. The hyphen is represented as <U002D>. So, you need to change the F to a D on both occasions.

After you have finished, save the file and exit xed.
 
2 members found this post helpful.
Old 01-07-2017, 07:48 AM   #20
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
Great. Now for some editing. The default text editor in Mint 18 is xed so we will use that. Again, because it is a system file we need to edit the file as if we were a root user, not an ordinary user. Because we are going to use a GUI program, namely xed, rather than a command on the command line, we use gksudo not sudo (there are some subtle differences between gksudo and sudo which you will find explained elsewhere on the web).

gksudo xed en_GB

You will notice a red bar at the top of the editor that says "Elevated Privileges". This is there to remind you that you are editing as root, not as an ordinary user.

Don't worry that the contents of the file look a bit gobbledy-gook. Those <U0073> etc. are just a way of expressing unicode characters (see here for a list of some of them - http://www.utf8-chartable.de/).

Scroll down until you see the LC_TIME section. Then scroll down until you see the subsection called d_fmt. This is the date format, which is currently set to (translating the unicode characters) %d/%m/%y.

The forward slash is represented as <U002F>. You should see two of them on that line. The hyphen is represented as <U002D>. So, you need to change the F to a D on both occasions.

After you have finished, save the file and exit xed.
I've done all that - hopefully correct.
 
Old 01-07-2017, 07:54 AM   #21
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by paxolin View Post
I've done all that - hopefully correct.
Excellent. Now we have to "generate" the locale. This is a way of making it available to the system. Run the following command to generate not only the en_GB locale, but also the small number of other locales that have been marked as potentially available (and which we haven't changed so no need to worry about those).

sudo locale-gen
 
Old 01-07-2017, 08:03 AM   #22
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
Excellent. Now we have to "generate" the locale. This is a way of making it available to the system. Run the following command to generate not only the en_GB locale, but also the small number of other locales that have been marked as potentially available (and which we haven't changed so no need to worry about those).

sudo locale-gen
I'm completely lost now as to what it's doing? I pasted the command and I see it's listed 18 "locales" is that the correct term?
(Including GB and TH, the two relevant ones?)


#en_AG.UTF-8... done
en_AU.UTF-8... done
en_BW.UTF-8... done
en_CA.UTF-8... done
en_DK.UTF-8... done
en_GB.UTF-8... done
en_HK.UTF-8... done
en_IE.UTF-8... done
en_IN.UTF-8... done
en_NG.UTF-8... done
en_NZ.UTF-8... done
en_PH.UTF-8... done
en_SG.UTF-8... done
en_US.UTF-8... done
en_ZA.UTF-8... done
en_ZM.UTF-8... done
en_ZW.UTF-8... done
th_TH.UTF-8... done#
 
Old 01-07-2017, 08:09 AM   #23
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by paxolin View Post
I'm completely lost now as to what it's doing? I pasted the command and I see it's listed 18 "locales" is that the correct term?
(Including GB and TH, the two relevant ones?)
Thanks. Don't worry about being "completely lost". You know when you write a program, and then you compile it so that the program can actually be run? You can think of locale-gen being the equivalent of compilation for locales. It now means that the system can use it.

Let's check that all is good. Enter the following on the command line (it will show you the current date expressed in the format described in the current locale i.e. en_GB):

date +%x

If this shows the date hyphenated as you require, relaunch Thunderbird Lightning and see if the date is now presented as you want it.
 
Old 01-07-2017, 08:17 AM   #24
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
Thanks. Don't worry about being "completely lost". You know when you write a program, and then you compile it so that the program can actually be run? You can think of locale-gen being the equivalent of compilation for locales. It now means that the system can use it.

Let's check that all is good. Enter the following on the command line (it will show you the current date expressed in the format described in the current locale i.e. en_GB):

date +%x

If this shows the date hyphenated as you require, relaunch Thunderbird Lightning and see if the date is now presented as you want it.
In the terminal window it does indeed show the date with the hyphen. However, I closed and reopened Thunderbird, but Calendar still shows the date with a forward slash.
I haven't tried rebooting yet. Reluctant to do that at the moment. Perhaps it's not necessary?
 
Old 01-07-2017, 08:21 AM   #25
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by paxolin View Post
In the terminal window it does indeed show the date with the hyphen. However, I closed and reopened Thunderbird, but Calendar still shows the date with a forward slash.
I haven't tried rebooting yet. Reluctant to do that at the moment. Perhaps it's not necessary?
It might be necessary to reboot, or at least to log out and log in again, depending on what Thunderbird has running in the background.

If we find that Thunderbird's Calendar isn't using the hyphens, then the Calendar isn't referring to your computer's current locale, and we'll have to find out how to change that.
 
1 members found this post helpful.
Old 01-07-2017, 08:35 AM   #26
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
It might be necessary to reboot, or at least to log out and log in again, depending on what Thunderbird has running in the background.

If we find that Thunderbird's Calendar isn't using the hyphens, then the Calendar isn't referring to your computer's current locale, and we'll have to find out how to change that.
Whoaaa! Rebooted Mint and Thunderbird is now using the hyphens!
Thanks so much for your help with this hydrurga. Obviously I had no idea what I was doing a lot of the time, but it does show I can follow meaningless (to me) instructions, ha ha!
 
Old 01-07-2017, 08:41 AM   #27
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by paxolin View Post
Whoaaa! Rebooted Mint and Thunderbird is now using the hyphens!
Thanks so much for your help with this hydrurga. Obviously I had no idea what I was doing a lot of the time, but it does show I can follow meaningless (to me) instructions, ha ha!
Splendid! If you actually look back at the instructions, and miss out all my waffle, there wasn't much to do at all.

One small caveat. You've effectively edited the en_GB locale. This means that if at any point in the future the en_GB locale file is updated by the system, you will need to make the same modification to the file. This is pretty unlikely however, although it might happen after a major upgrade to a new version of Mint. It is worth bearing in mind though just in case you see those forward slashes appear again at some point and wonder what's happened.

Enjoy!
 
1 members found this post helpful.
Old 01-07-2017, 08:55 AM   #28
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
Splendid! If you actually look back at the instructions, and miss out all my waffle, there wasn't much to do at all.

One small caveat. You've effectively edited the en_GB locale. This means that if at any point in the future the en_GB locale file is updated by the system, you will need to make the same modification to the file. This is pretty unlikely however, although it might happen after a major upgrade to a new version of Mint. It is worth bearing in mind though just in case you see those forward slashes appear again at some point and wonder what's happened.

Enjoy!
OK, I've saved your excellent instructions, in case I need to refer to them in the future. Thanks again.
 
Old 01-07-2017, 09:09 AM   #29
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,646
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
I've copied this as well. I've never needed to edit a locale so far but it's nice to know I now can if I want to. And I've marked the edit instructions as helpful. I suggest, paxolin, that you do the same.
 
Old 01-07-2017, 09:40 AM   #30
paxolin
Member
 
Registered: Jan 2017
Location: Thailand
Distribution: Mint 20.3 Cinnamon 64-bit 12Gb RAM (Linux newbie, Dummies level)
Posts: 412

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
I've copied this as well. I've never needed to edit a locale so far but it's nice to know I now can if I want to. And I've marked the edit instructions as helpful. I suggest, paxolin, that you do the same.
I'd marked some of the other posts in hydrurga's instructions as helpful already.
OK, I've added the specific one regarding editing the locale too, now.
 
  


Reply



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
changing date format kuddush Linux - Desktop 1 03-28-2011 08:40 AM
Changing the default date format for Open Office.org pwabrahams Linux - Software 6 09-26-2010 09:05 PM
Changing the Time/Date format WilliaMITCHELL Ubuntu 3 09-28-2008 12:34 PM
Changing System Date Format to DD/MM/YY On RHEL3? krishvij Linux - Newbie 2 03-16-2005 06:58 AM
Changing date format in MySQL table vous Linux - Software 8 09-03-2003 06:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint

All times are GMT -5. The time now is 12:51 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
Open Source Consulting | Domain Registration