Automated Dates

The first thing that Joe notices he can do is to automate the date in the copyright notice (which he gets tired of updating each year). He changes the template as follows:

## template=JavaJoe Copyright
#today ( $year "yyyy" )
/*
 * MyClass.java
 *
 * Copyright (c) ${year} Java Joe
 * Give my code a good home.
 */

By using the #today directive, Joe assigns the value of the current date, formatted as a four digit year, to the "year" variable. Then within the copyright notice, Joe references this variable to add the current year.

Note also that Joe has added a template label to the top of the file, which will be displayed in the Templates menu, as well as the dockable template browser.