Converts date/time related values into Coordinated Universal Time and into a fixed (normalized) representation that can be sorted and compared lexicographically.
string ms:utc(string)
This function works only with time instances such as timeInstant, time, date, yearMonth, year, monthDay, day, and month. The utc()
function does not work with periods of time such as timeDuration or its derived types. For nonstring arguments, this function acts as if a string function were first applied. This function does not depend on the presence of XSD information. If a string cannot be interpreted as a valid XSD date/time-related format, it returns an empty string. The rules for date/time values are:
YYYY-MM-DDTHH:NN:SS.III
where
Characters | Represents |
---|---|
YYYY | A four digit year (for example, 2001). |
MM | The number of a month (for example, 01 for January). |
DDD | A day of a month. Three digits are used to accommodate the ability to point out the exact day of the year (for example, in "2001-04-123", 123 points out the 123rd day of the year) . |
HH | A two-digit hour (for example, "00-23"). |
SS | Seconds (for example, "00-59"). |
III | Milliseconds (for example, "000-999"). If no milliseconds are specified, dashes representing milliseconds are right-truncated. |
utc()
function returns an empty string because negative timeInstances, periods, invalid Gregorian dates and other cases described in the following string constraints section will not be able to compare correctly.String Comparison Constraints: