Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » JDT automatic source annotation *date format*
JDT automatic source annotation *date format* [message #192102] Sun, 09 January 2005 23:58 Go to next message
Eclipse UserFriend
Originally posted by: natgross.rentalsystems.verizon.net

Hi;
On a WinXP platform, with Eclipse 3.0.1, although I have my Regional
settings set to US, the automatic ${date} that gets inserted in my code
is European format.
I have searched thru the preferences and failed to find where I can
adjust this to get the US format.

Please advise;
Thank you;
-nat
Re: JDT automatic source annotation *date format* [message #192185 is a reply to message #192102] Mon, 10 January 2005 17:33 Go to previous messageGo to next message
Tom Hofmann is currently offline Tom HofmannFriend
Messages: 770
Registered: July 2009
Senior Member
Nat Gross wrote:
> Hi;
> On a WinXP platform, with Eclipse 3.0.1, although I have my Regional
> settings set to US, the automatic ${date} that gets inserted in my code
> is European format.

You mean the ${date} in the default file template? It is the output of

return DateFormat.getDateInstance().format(new java.util.Date());

so I assume you have set your locale to european style somewhere.

-tom
Re: JDT automatic source annotation *date format* [message #192200 is a reply to message #192185] Mon, 10 January 2005 19:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: natgross.rentalsystems.verizon.net

Tom Eicher wrote:
> Nat Gross wrote:
>
>> Hi;
>> On a WinXP platform, with Eclipse 3.0.1, although I have my Regional
>> settings set to US, the automatic ${date} that gets inserted in my
>> code is European format.
>
>
> You mean the ${date} in the default file template?
Yes.

>It is the output of
>return DateFormat.getDateInstance().format(new java.util.Date());
Hey. Never noticed that since I use a per-locale formatter in my code.
You are correct though, that this line of code returns European style
for me.

> so I assume you have set your locale to european style somewhere.
It's the million dollar question. Where? My XP Region is set to US.
I might have to resort to start Eclipse with a jvm parameter to set
locale, but hesitate to do so, because portions of my code is locale
specific, and I don't want the jvm parameter to 'confuse' the code.
Hopefully this fear is unfounded, and since I do not know what's causing
the Euro style date (maybe a hangover of a Windozzz crash), I should
just set the Eclipse's startup jvm's locale?

> -tom
Thank you much;
-nat
Re: JDT automatic source annotation *date format* [message #192243 is a reply to message #192200] Tue, 11 January 2005 10:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zoopy.hates.spam.biz

On 10-1-2005 20:01, Nat Gross wrote:
> Tom Eicher wrote:
>
>> Nat Gross wrote:
>>
>>> Hi;
>>> On a WinXP platform, with Eclipse 3.0.1, although I have my Regional
>>> settings set to US, the automatic ${date} that gets inserted in my
>>> code is European format.
>>
>>
>>
>> You mean the ${date} in the default file template?
>
> Yes.
>
>> It is the output of return DateFormat.getDateInstance().format(new
>> java.util.Date());
>
> Hey. Never noticed that since I use a per-locale formatter in my code.
> You are correct though, that this line of code returns European style
> for me.
>
>> so I assume you have set your locale to european style somewhere.
>
> It's the million dollar question. Where? My XP Region is set to US.
> I might have to resort to start Eclipse with a jvm parameter to set
> locale, but hesitate to do so, because portions of my code is locale
> specific, and I don't want the jvm parameter to 'confuse' the code.
> Hopefully this fear is unfounded, and since I do not know what's causing
> the Euro style date (maybe a hangover of a Windozzz crash), I should
> just set the Eclipse's startup jvm's locale?
>
>> -tom
>
> Thank you much;
> -nat

You can use the '-nl' parameter to the Eclipse executable. See
Help/Workbench User Guide/Tasks/Running Eclipse. E.g. with the Dutch
locale nl_NL:

"C:\Program Files\Eclipse\eclipse.3.0.1\eclipse\eclipse.exe" -nl nl_NL
-vm "C:\Program Files\Java\j2re1.4.2\bin\javaw.exe" -vmargs -Xmx192m

This produced the following date comment in a newly created class:
/**
* <code>DateLocaleTest</code>
* @author SmithZ
* @created 11-jan-2005
*/

Using '-nl en_US', it produced:
/**
* <code>DateLocaleTest2</code>
* @author SmithZ
* @created Jan 11, 2005
*/

In 'Help/About Eclipse Platform/Configuration details' you can verify
the locale used by the JVM. Even with the parameter '-nl nl_NL' I see
user.country=US
user.language=en
but also
osgi.nl=nl_NL

HTH,

--
Regards,
Z.
Re: JDT automatic source annotation *date format* [message #192258 is a reply to message #192243] Tue, 11 January 2005 15:00 Go to previous message
Eclipse UserFriend
Originally posted by: natgross.rentalsystems.verizon.net

Zoopy wrote:
> On 10-1-2005 20:01, Nat Gross wrote:
>
>> Tom Eicher wrote:
>>
>>> Nat Gross wrote:
>>>
>>>> Hi;
>>>> On a WinXP platform, with Eclipse 3.0.1, although I have my Regional
>>>> settings set to US, the automatic ${date} that gets inserted in my
>>>> code is European format.
>>>
>>>
>>>
>>>
>>> You mean the ${date} in the default file template?
>>
>>
>> Yes.
>>
>>> It is the output of return DateFormat.getDateInstance().format(new
>>> java.util.Date());
>>
>>
>> Hey. Never noticed that since I use a per-locale formatter in my code.
>> You are correct though, that this line of code returns European style
>> for me.
>>
>>> so I assume you have set your locale to european style somewhere.
>>
>>
>> It's the million dollar question. Where? My XP Region is set to US.
>> I might have to resort to start Eclipse with a jvm parameter to set
>> locale, but hesitate to do so, because portions of my code is locale
>> specific, and I don't want the jvm parameter to 'confuse' the code.
>> Hopefully this fear is unfounded, and since I do not know what's
>> causing the Euro style date (maybe a hangover of a Windozzz crash), I
>> should just set the Eclipse's startup jvm's locale?
>>
>>> -tom
>>
>>
>> Thank you much;
>> -nat
>
>
> You can use the '-nl' parameter to the Eclipse executable. See
> Help/Workbench User Guide/Tasks/Running Eclipse. E.g. with the Dutch
> locale nl_NL:
>
> "C:\Program Files\Eclipse\eclipse.3.0.1\eclipse\eclipse.exe" -nl nl_NL
> -vm "C:\Program Files\Java\j2re1.4.2\bin\javaw.exe" -vmargs -Xmx192m
>
> This produced the following date comment in a newly created class:
> /**
> * <code>DateLocaleTest</code>
> * @author SmithZ
> * @created 11-jan-2005
> */
>
> Using '-nl en_US', it produced:
> /**
> * <code>DateLocaleTest2</code>
> * @author SmithZ
> * @created Jan 11, 2005
> */
>
> In 'Help/About Eclipse Platform/Configuration details' you can verify
> the locale used by the JVM. Even with the parameter '-nl nl_NL' I see
> user.country=US
> user.language=en
> but also
> osgi.nl=nl_NL
>
> HTH,
>
The -nl did the trick. However, my concern is that strings within my
sources that are *not* en_US, should not become confused.
I would much rather prefer a simple setting in preferences for the date
format of dates inserted in my source.
Also, a little peculiar thing. Before I set it to en_US, the date was
Euro format, but with numbers (Jan 10 was 10/1/2005), now it is indeed
set to US, but not numbers, rather Jan 10, 2005 string. Just wondering...
Thanks;
-nat
Previous Topic:ant build v Eclipse build mismatch
Next Topic:Looking for system memory requirements
Goto Forum:
  


Current Time: Wed Jul 17 14:27:44 GMT 2024

Powered by FUDForum. Page generated in 0.02988 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top