Datetime Functions

years-from-duration( xs:yearMonthDuration("P20Y15M")) 21
months-from-duration( xs:yearMonthDuration( "-P20Y18M")) -6
days-from-duration( xs:dayTimeDuration("P3DT55H")) 5
hours-from-duration( xs:dayTimeDuration( "P3DT12H32M12S")) 12
minutes-from-duration( xs:dayTimeDuration( "P3DT10H")) 0
seconds-from-duration( xs:dayTimeDuration( "-PT256S")) -16
dateTime( xs:date("1999-12-31"), xs:time("12:00:00")) xs:dateTime( ‘1999-12-31 T12:00:00’)
year-from-dateTime( xs:dateTime( "1999-05-31 T13:20:00-05:00")) 1999
month-from-dateTime( xs:dateTime( "1999-05-31 T13:20:00-05:00")) 5
day-from-dateTime( xs:dateTime("1999-05-31 T13:20:00-05:00")) 31
hours-from-dateTime( xs:dateTime("1999-05-31 T08:20:00-05:00")) 8
minutes-from-dateTime( xs:dateTime("1999-05-31 T13:20:00-05:00"))  20
seconds-from-dateTime( xs:dateTime("1999-05-31 T13:20:00-05:00")) 0
timezone-from-dateTime( xs:dateTime("1999-05-31 T13:20:00-05:00")) xs:dayTimeDuration("-PT5H")
year-from-date( xs:date("1999-05-31")) 1999
month-from-date( xs:date("1999-05-31-05:00")) 5
day-from-date( xs:date("1999-05-31-05:00")) 31
timezone-from-date( xs:date("1999-05-31-05:00")) xs:dayTimeDuration("-PT5H")
hours-from-time( xs:time("11:23:00")) 11
minutes-from-time( xs:time("13:00:00Z")) 0
seconds-from-time( xs:time("13:20:10.5")) 10.5
timezone-from-time( xs:time("13:20:00Z")) xs:dayTimeDuration(‘PT0S’)
adjust-dateTime-to-timezone( xs:dateTime('2002-03-07 T00:00:00+01:00'), xs:dayTimeDuration( "-PT8H")) xs:dateTime('2002-03-06T15:00:00-08:00')
adjust-date-to-timezone( xs:date("2002-03-07-07:00"), xs:dayTimeDuration( "-PT10H"))   xs:date("2002-03-06-10:00")
adjust-time-to-timezone( xs:time("10:00:00-07:00"), xs:dayTimeDuration( "-PT10H"))  xs:time("07:00:00-10:00")
format-date( xs:date('2002-12-31'), "[MNn] [D], [Y]", "en", (), ()) December 31, 2002
format-time( xs:time('15:58:45'), "[h]:[m01]:[s01] [Pn]","en",(),()) 3:58:45 pm
format-dateTime( $xs:dateTime( “2002-12-31T15:58:45”), "[M01]/[D01]/[Y0001] at [H01]:[m01]:[s01]") 12/31/2002 at 15:58:45
current-dateTime() xs:dateTimeStamp(‘2014-09-06T07:30:58.767’)
current-date() xs:date(‘2014-09-06’)
current-time() xs:time(‘07:31:54.574’)
implicit-timezone() xs:dayTimeDuration(‘PT8H’)
default-collation() http://www.benibela.de/2012/pxp/case-insensitive-clever