NetBeans IDE: Date Formatting in Templates

I've been trying out the NetBeans IDE and have created some templates for my new files. However, I don't like the standard date format returned by the ${date} variable. I found this page, which gives a hint at the solution:

The ${date} variable returns a string. Since the string is already formatted "wrong", standard string manipulation won't help. The trick is to cast the date string back to a date, and then apply your formatting. Here are some examples:


returns the date in a format like 03-Nov-2009.

${date?date?string("d MMMM yyyy")}

(my favorite!) returns the date in a format like 3 November 2009.

Now that you know the "trick" it should be pretty straightforward to convert dates into your favorite format too!