Adding the Current Date and Time to a JUnit Report
R. Kevin ColeSeptember 24, 2003

You can customize junit's stylesheet by adding java.util.Date to the namespace like this:

<xsl:stylesheet	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:Date="http://www.saxon.com/java/java.util.Date">

java.util.Date is now available in the namespace and can be inserted into the xsl stylesheet something like this:

	Last Modified: <xsl:value-of select="Date:toString(Date:new())" />

Ant's optional.jar library contains two JUnit stylesheets called junit-frames.xsl and junit-noframes.xsl. These files can be extracted and modified as illustrated above to insert a date and time string into your reports.