Start a Conversation

Unsolved

This post is more than 5 years old

1339

November 8th, 2013 05:00

Wrong locale with recent java on NMC (from nw 8.0.2.4)

With recent Oracle java versions, 1.7.0.45 being the latest, the time (and date) does not use the correct format provided by the LANG (or LC_ALL) environment.

I have been using en_GB.utf8 as the locale LANG setting and I have gotten the correct 24H time and dd/mm/yyyy date format. But the latest java-version, where this works is 1.7.0.21.

I use this on linux, but have also tested it on windows and the same problem is there.

It seems, that the only thing the locale is affecting is the language of the am/pm suffix. (Swedish. 09:30 fm, 11:00 em or Finnish 08:45 ap, 02:25 ip) This is so pathetic...

Will this be fixed? It is not really cool to use an old buggy and insecure version just to make this basic thing to work.

--

tonyk.

November 9th, 2013 10:00

Please consider moving this question as-is (no need to recreate) to the proper forum for maximum visibility.  Questions written to the users' own "Discussions" space don't get the same amount of attention and can go unanswered for a long time.

You can do so by selecting "Move" under ACTIONS along the upper-right.  Then search for and select: "NetWorker Support Forum".

NetWorker Support Forum

14.3K Posts

November 11th, 2013 01:00

I wonder if you are talking about Java 7 default locale.

27 Posts

November 11th, 2013 06:00

I wish I would.

I tried setting the sun.locale.formatasdefault to true by running this (on linux):

LANG=sv_SE.utf8 javaws -J-Dsun.locale.formatasdefault=true http://nmc-server:9000/gconsole.jnlp

But there is no difference. Still the same effect. The LANG env only defines what is the language of the am/pm suffix.

On windows there is a difference, but this is probably expected. With the formatasdefault=true I do get the localized version of the am/pm suffix, but with false (or without it) I get AM/PM. But still no possibility to get the 24 hour time format.

I did some java testing and running this one:  JavaTechniques » DateFormat and SimpleDateFormat Examples

on linux with the latest java does show the correct time formats:

java$ LANG=en_US java DateFormatExample1

1. Mon Nov 11 16:25:30 EET 2013

2. 11/11/13 4:25 PM

3. 4:25:30 PM

4. Nov 11, 2013 4:25:30 PM

5. 4:25 PM

6. 4:25:30 PM

7. 4:25:30 PM EET

8. 11/11/13 4:25 PM

9. Nov 11, 2013 4:25 PM

10. November 11, 2013 4:25:30 PM EET

java$ LANG=en_GB java DateFormatExample1

1. Mon Nov 11 16:25:38 EET 2013

2. 11/11/13 16:25

3. 16:25:38

4. 11-Nov-2013 16:25:38

5. 16:25

6. 16:25:38

7. 16:25:38 EET

8. 11/11/13 16:25

9. 11-Nov-2013 16:25

10. 11 November 2013 16:25:38 EET

I really hope there would be a workaround for this.

(This forum could also use the correct language settings that I have set in my preferences.)

27 Posts

November 19th, 2013 01:00

Doesn't anyone have a clue?

(And why is my previous post still "Currently being moderated." ???)

14.3K Posts

November 19th, 2013 02:00

Funny enough - I have seen this also on one server in Sweden, but it only affects time in messages window.  We checked against logs and there all is ok so we don't bother much, but I might check it more in depth this week.

75 Posts

November 22nd, 2013 05:00

I'm seeing this too on at least two installations here in DK.

I haven't investigated much, but it seems like a bug to me.

/tony

27 Posts

February 10th, 2014 04:00

This problem is (at least for me) solved by using OpenJDK (1.7.0.60) and the icedtea (1.4.1) webstart plugin on linux. Didn't have any luck with Open-JDK and NMC previously, but now it seems to work flawlessy!

Also understand from other sources, that the time/date format problem on Oracle Java is fixed in nw 8.1.

No Events found!

Top