Node:Step 8, Next:, Previous:Step 7, Up:Tutorial



Step 8: Timestamps

Transbuild also provides an extension XPath function to create timestamps. The function is called timestamp.

It can be used to output times in a user defined format. It can generate several different times: the last modified time of the source file, the time Transbuild is run, or the time from text in the source file. It can also convert the time into any desired timezone. However, in this tutorial the simple form will be used to display the last modified time of the source file, in the default format, and in the default UTC timezone. The other options are documented in the reference section.

    ...
    <div class="main">
      <xsl:apply-templates/>
      <p class="timestamp">
        Last updated: <xsl:value-of select="TBF:timestamp()"/>
      </p>
    </div>
  </body>

If you define your own time format, it is best to stick to the ISO 8601 standard or the W3C Date Time Format profile of it.

This step can be tested with the tb-step08.xml build script.