You want to insert the current date, time, or both into your output format (for example, to show the date of creation).
Use the <?dbtimestamp?>
processing
instruction (PI). For example, integrate it into the
pubdate
to show the current publication date on the
titlepage:
<info>
<!-- ... -->
<pubdate><?dbtimestamp?></pubdate>
</info>
The above PI includes the date in its
localized form, or in other words: the
output depends on the current language. If you do not have set any
language, the default is English (en_US
) which is
month/day/year
. If you want to
change the default format, use one of the two options:
Change the default format
Add pseudo-attributes
Each language contains the context datetime
in its
language files add xref. The following
code is from the English language file:
<l:context name="datetime"> <l:template name="format" text="m/d/Y"/> </l:context>
This is only useful, if you want to completely change the appearance of a date in your document.
The simpler method is to change the PI directly. Especially
if you do not want to customize the date for the complete
document or you want it change individually. Basically, add a
pseudo-attribute[5] into the <?dbtimestamp?>
PI.
For example, if you want to insert the year only, add the format
pseudo-attribute:
<?dbtimestamp format="Y"?>
More format-letters can be found in the reference page (see link in the See Also section).
http://docbook.sourceforge.net/release/xsl/current/doc/pi/dbtimestamp.html, the reference page for the PI
[5] A pseudo-attribute looks like an XML attribute due to its similar syntax. However, it is not. A processing instruction can only contain text and no attributes. For more information about PIs, refer to the XML specification at http://www.w3.org/TR/REC-xml/#sec-pi.
Project@GitHub | Issue#7 |