JVM Help

Jun. 8th, 2006 07:29 pm
dcseain: Cast shot of me playing my violin in role of minstrel in the Two Gentlemen of Verona (Default)
[personal profile] dcseain
Fellow geeks, I have a user with a query, and i'm having trouble finding the answer. I need a java VM switch, likely a -Duser.x that will allow one to tell a VM to use 24-Hour time format instead of defualt for English(United States), and a switch to overide the default date setting also; both to suppress the date, and to change the date format. The closest i've found so far is -Duser.timezone=GMT(+\-)n. That's fine and well, but timezone is not the issue, but rather date/time format. Suggestions?

Date: 2006-06-09 04:29 am (UTC)
From: [identity profile] madbodger.livejournal.com

Check it out.
(http://javatechniques.com/public/java/docs/basics/dateformat-examples.html)

Date: 2006-06-09 02:16 pm (UTC)
From: [identity profile] dcseain.livejournal.com
Yeah, i've found that, but that's programatically. Eventually, i might convince Program Management to put date/time format configurability into the client, but until then, I need to be able to set this in the Java Client as a start-up switch.

For example:

-Xmx256m "-Xloggc:C:\\App\logs\fsgc.log" -Duser.timeformat="HH:mm:ss"

except that -Duser.timeformat is not a valid switch. I've found 3rd-party apps that do that, but that's not helpful either.

Can you switch the Locale()?

Date: 2006-06-20 09:33 pm (UTC)
From: [identity profile] blackfeather.livejournal.com
If so, then there are several Locale settings which will give a default 24 hour clock (and for long formats, still use English). I've written two really small classes, one of which will print out all System properties, and another which will show the different locales and a Date formatted to that locale. To set the locale right it seems you need to use -D flag to set both user.language and user.country . From what I can see en_GB will use the 24 hour clock.

If you want the small sample classes, I can mail you those, too.

Sorry it took a while (12 days), but I got the idea here after I was reading about the System class. Hopefully this is still useful! :-)

-- Helgi / Craig

Re: Can you switch the Locale()?

Date: 2006-06-20 09:38 pm (UTC)
From: [identity profile] dcseain.livejournal.com
This is true, but en_GB will also sub £ for $, as well as alter date format and spellings for a number of words.

Profile

dcseain: Cast shot of me playing my violin in role of minstrel in the Two Gentlemen of Verona (Default)
dcseain

June 2013

S M T W T F S
      1
2345678
9101112131415
161718192021 22
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 30th, 2025 03:49 am
Powered by Dreamwidth Studios