Name
[2.0]
minutes-from-dateTime()
Given an xs:dateTime, returns its minutes
value.
Syntax
xs:integer?minutes-from-dateTime(xs:dateTime?)
Inputs
An xs:dateTime
value.
Output
An xs:integer
representing the minutes component of the given xs:dateTime value. If the argument is
the empty sequence, this function returns the empty
sequence.
Defined in
XQuery 1.0 and XPath 2.0 Functions and Operators section 10.5, “Component Extraction Functions on Durations, Dates and Times.”
Example
This stylesheet demonstrates the minutes-from-dateTime()
function:
<?xml version="1.0"?> <!-- minutes-from-datetime.xsl --> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:text>
Extracting the minutes from an xs:dateTime:</xsl:text> <xsl:variable name="currentDateTime" as="xs:dateTime" select="current-dateTime()"/> <xsl:text>

 The current date and time is: </xsl:text> <xsl:value-of select="$currentDateTime"/> <xsl:text>

 The current minute is: </xsl:text> <xsl:value-of select="minutes-from-dateTime($currentDateTime)"/> </xsl:template> </xsl:stylesheet>
The stylesheet creates these results:
Extracting the minutes from an xs:dateTime: The current date and time is: 2006-11-16T04:34:19.921-05:00 The current minute is: 34
See Also
The definitions of the [2.0]
day-from-dateTime(), [2.0] format-dateTime(), [2.0]
hours-from-dateTime(), [2.0]
month-from-dateTime(), [2.0]
seconds-from-dateTime() ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access