problems with date format in ${date} [message #290339] |
Wed, 24 August 2005 07:10 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03305 seconds