com.reverseXSL.util
Class CurrentDate

java.lang.Object
  extended by com.reverseXSL.util.CurrentDate

public class CurrentDate
extends java.lang.Object

To be used as Xalan XSLT extension function for inserting the current date into XSLT outputs.

use as follows in XSLT scripts:

<xsl:stylesheet version="1.0" xmlns:fct="com.reverseXSL.util.CurrentDate" extension-element-prefixes="fct" xmlns:rx="http://reverseXSL.com" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
...
<xsl:text>DATETIME=</xsl:text>
<xsl:value-of select="fct:nowDate()"/>
...


which will generate in output:
DATETIME=2007-07-11 07:51:03+0200


Constructor Summary
CurrentDate()
           
 
Method Summary
static java.lang.Object nowDate()
          Returns a predefined-format date string.
static java.lang.Object nowDate(java.lang.String dateFormat)
          Returns a date string formatted as specified in argument.
static java.lang.Object nowXMLDate()
          Returns a date and time value compliant with the XML-schema dateTime simple type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrentDate

public CurrentDate()
Method Detail

nowDate

public static java.lang.Object nowDate()
Returns a predefined-format date string.

Returns:
"yyyy-MM-dd HH:mm:ssZ", e.g. "2007-07-11 07:51:03+0200"

nowDate

public static java.lang.Object nowDate(java.lang.String dateFormat)
Returns a date string formatted as specified in argument.

Parameters:
dateFormat - as specified in java.text.SimpleDateFormat.
Returns:
formatted date string

nowXMLDate

public static java.lang.Object nowXMLDate()
Returns a date and time value compliant with the XML-schema dateTime simple type.

Returns:
almost as "yyyy-MM-ddTHH:mm:ss.SSSZ" but amended to insert a colon in the timeZone offset, i.e. "2008-05-31T13:20:00.000-05:00"