Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently our organization got a couple of server boxes which are I guess present in some data-center in UK. The problem is that for some reason the default Locale representation in Java on that server returns en_US instead of the expected en_GB (I confirmed this by running a code on that server which simply outputs Locale.default()). I am pretty sure this has got something to do the way in which the boxes were set up.

My question is: what would be the approach to fix this issue now that the OS has been installed? Is there any way I can for a given SSH session set the locale as en_GB instead of the current en_US?


share|improve this question
up vote 1 down vote accepted

may help you setup your said location

share|improve this answer
Unfortunately that doesn't work. For some reason it seems that setting the TZ variable has no effect on the default Locale returned by Java. Even after doing export TZ=Asia/Tokyo, the default locale returned is en_US. – sasuke Oct 31 '10 at 14:03
You can make this change permanent for yourself by appending the line TZ='Asia/Tokyo'; export TZ to the file '.profile' in your home directory; then log out and log in again. – Rajat Nov 2 '10 at 4:22

have you tried changing the LANG environment variable in /etc/sysconfig/i18n ?

share|improve this answer
But that doesn't seem to be a per user configuration, right? I mean like I can change the format of the time shown by commands like ls by changing the environment variable TZ, can I change the locale on a per-ssh-session basis by setting some environment variable? – sasuke Dec 6 '10 at 20:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.