Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347399

Summary: [templates] Add date component variable (month, day) to the Code/Editor Templates Variables
Product: [Eclipse Project] JDT Reporter: Martin Ahrer <martin.ahrer>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert
Version: 3.6.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Martin Ahrer CLA 2011-05-27 02:53:34 EDT
Currently code template variables offer variables ${date} and ${year}. However in an environment where file headers contain a date (of creation) the needs to follow a fixed pattern (e.g. YYYY-MM-DD) the date can only be composed by something like ${year}-${month}-${day}.
So it would be helpful to have those additional variables.

Alternatively to adding new variables I could imagine that the templates support evaluating simple Java code snippets like:

"DateFormat.getDateInstance().format(new java.util.Date())"

This would open up a lot of opportunities to extend templates.
Comment 1 Dani Megert CLA 2011-05-27 05:07:24 EDT

*** This bug has been marked as a duplicate of bug 75981 ***