sql:datepart( $datepart as xs:string?, $date as xs:genericDateTimeArg ) as xs:integer?
Returns an integer that represents the specified datepart
of the specified
date
.
If datepart
or date
is the empty sequence, the
function returns the empty sequence.
This function is only available for use within SQL; it is not available directly from XQuery, XSLT, or JavaScript.
select datepart('yy','2007-10-30T12:15:32.1234567+05:10') returns 2007
sql:datepart("dayofyear",'2007-10-30T12:15:32.1234567+05:10') returns 303