sourabhjha
Programmer
I have a code where i am getting defaultlocale using locale class.On windows it returns me "en_us" but on unix it returns me "en".How do i make it consistent on both the platforms
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
import java.util.*;
public class LocaleTest {
public static void main(String[] args) {
System.getProperties().list(System.out);
System.out.println(Locale.getDefault());
System.out.println(new Date());
}
}
LANG=en_GB java LocaleTest
...
en_GB <-- the locale
Tue Feb 25 10:57:39 GMT 2003
LANG=en_US.UTF-8 java LocaleTest
...
en_US <-- the locale
Tue Feb 25 10:58:13 GMT 2003