Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » problems with date format in ${date}
problems with date format in ${date} [message #290339] Wed, 24 August 2005 07:10 Go to next message
Eclipse UserFriend
Originally posted by: yndu.telecable.es

Hi,

I need to change the date format in ${date} variable to insert a comment
in all my files.

Now, the format is 23-ago-2005 and I need to have this one: 23/08/2005

I have read that I need to modify GlobalTemplateVariables.java.
I found it in
..\eclipse\plugins\org.eclipse.platform.source_3.1.0\src\org .eclipse.text_3.1.0\src.zip
In org\eclipse\jface\text\templates

And I changed this:

public static class Date extends SimpleTemplateVariableResolver {
/**
* Creates a new date variable
*/
public Date() {
super("date",
TextTemplateMessages.getString("GlobalVariables.variable.description.date "));
//$NON-NLS-1$ //$NON-NLS-2$ }

protected String resolve(TemplateContext context) {
//return DateFormat.getDateInstance().format(new java.util.Date());
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
return df.format(new java.util.Date()); } }

I restart my eclipse, whith -clean option, but it continue writing the old
format :(

Have you any idea how can I configure this?

I use Eclipse 3.1.0 version

Thanks and sorry for my english :S

Ana
Re: problems with date format in ${date} [message #290346 is a reply to message #290339] Wed, 24 August 2005 11:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

Yes, it's a bit weird. It's using the Java default 'MEDIUM' format, which is unfortunately one thing you can't change from the host operating system easily, nor override it with a variable.

One thing that might be the issue with the runtime workspace is that the -clean option might not clean everything. I've had that before where it cleans projects from the workspace but not all expanded manifest files etc.

Try getting rid of the '.metadata' director in the runtime-workspace location (not the main Eclipse one!) to see if that fixes the issue.
Re: problems with date format in ${date} [message #290353 is a reply to message #290346] Wed, 24 August 2005 12:59 Go to previous message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

There's a bug associated with this requirement already:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=105802

Not that it helps, but it's already been thought of by others.
Previous Topic:debugging - dource not found
Next Topic:Switch off default enablement of activity
Goto Forum:
  


Current Time: Fri Mar 29 08:32:56 GMT 2024

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

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

Back to the top