functx:dateTime
Construct a date/time from individual components
Description
The functx:dateTime function constructs an xs:dateTime value from arguments representing the year, month, day, hour, minute and second. The arguments can have any type that can be cast to xs:integer. If the combination does not result in a valid time (e.g. the day is 32 or the minute is 61), an error is raised. The function does not currently support decimal numbers for $second.
Parameters |
Description |
---|---|
year:date() |
the year |
month:date() |
the month |
day:date() |
the day |
hour:time() |
the hour |
minute:time() |
the minute |
second:time() |
the second |
Examples
XPath |
Results |
---|---|
functx:dateTime(2006,6,12,20,6,12) |
2006-06-12T20:06:12 |
functx:dateTime(‘2006’,’6’,’12’,’20’,’6’,’12’) |
2006-06-12T20:06:12 |