{ "ns" : "http://zorba.io/modules/datetime", "description" : "

This module provides functions to retrieve the current dateTime and to\n parse dates and times.

\n

\n

In contrast to the current-dateTime functions specified in\n XQuery Functions and\n Operators, the functions in this module are nondeterministic, that is,\n they do not return the current dateTime from the dynamic context, but return\n the actual value.

\n

\n

Dates and times are parsed according to the format given by\n strptime.

\n

However, date and time values must be \"complete.\"

\n

For a date, the year and either month and day or day of the year must have\n been parsed.

\n

For a time, the hour must have been parsed.\n (If either the minute, second, or timezone has not been parsed, they default\n to 0.)

\n

For a dateTime, the parsing requirements of both date and time must be met.

\n

\n

When a locale is given,\n it must be of the form {lang}[{sep}{country}[{encoding}]] where\n {lang} is an ISO 639-1 2-letter or 639-2 3-letter language code,\n {sep} is either '-' or '_',\n {country} is an ISO 3166-1 2-letter country code,\n and {encoding} is any string that begins with a '.'.

\n

The {sep}, {country}, and {encoding} are optional;\n {encoding} is always ignored.

\n

Examples include: de, en-US, fr_CA, ru_RU.UTF-8.

\n", "sees" : [ "http://www.w3.org/TR/xpath-functions/#context" ], "authors" : [ "Matthias Brantner", "Paul J. Lucas" ], "version" : null, "encoding" : "utf-8", "namespaces" : [ { "uri" : "http://zorba.io/annotations", "prefix" : "an" }, { "uri" : "http://zorba.io/modules/datetime", "prefix" : "datetime" }, { "uri" : "http://zorba.io/options/versioning", "prefix" : "ver" } ], "functions" : [ { "arity" : 0, "name" : "current-date", "qname" : "datetime:current-date", "signature" : "() as xs:date external", "description" : "

Gets the current date value in Universal time.

\n

Note that this function is not stable: it returns the value of the date when\n the function is invoked.

\n", "summary" : "

Gets the current date value in Universal time.

", "annotation_str" : " %an:nondeterministic", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "nondeterministic", "value" : "" } ], "updating" : false, "parameters" : [ ], "returns" : { "type" : "xs:date", "description" : "the non-stable date value" }, "errors" : [ ] }, { "arity" : 0, "name" : "current-dateTime", "qname" : "datetime:current-dateTime", "signature" : "() as xs:dateTimeStamp external", "description" : "

Gets the current dateTime value in Universal time.

\n

Note that this function is not stable: it returns the value of the date and\n time when the function is invoked.

\n", "summary" : "

Gets the current dateTime value in Universal time.

", "annotation_str" : " %an:nondeterministic", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "nondeterministic", "value" : "" } ], "updating" : false, "parameters" : [ ], "returns" : { "type" : "xs:dateTimeStamp", "description" : "the non-stable datetime value" }, "errors" : [ ] }, { "arity" : 0, "name" : "current-time", "qname" : "datetime:current-time", "signature" : "() as xs:time external", "description" : "

Return the current time value in Universal time.

\n

Note that this function is not stable: it returns the value of the time when\n the function is invoked.

\n", "summary" : "

Return the current time value in Universal time.

", "annotation_str" : " %an:nondeterministic", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "nondeterministic", "value" : "" } ], "updating" : false, "parameters" : [ ], "returns" : { "type" : "xs:time", "description" : "the non-stable time value" }, "errors" : [ ] }, { "arity" : 1, "name" : "millis-to-dateTime", "qname" : "datetime:millis-to-dateTime", "signature" : "($millis as xs:long) as xs:dateTime external", "description" : "

Converts the given number of milliseconds since epoch into its corresponding\n xs:dateTime.

\n", "summary" : "

Converts the given number of milliseconds since epoch into its corresponding\n xs:dateTime.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "millis", "type" : "xs:long", "occurence" : null, "description" : "
The number of milliseconds since epoch.
" } ], "returns" : { "type" : "xs:dateTime", "description" : "Returns an xs:dateTime." }, "errors" : [ ] }, { "arity" : 2, "name" : "parse-date", "qname" : "datetime:parse-date", "signature" : "($input as xs:string, $format as xs:string) as xs:date external", "description" : "

Parses a date from a string in the current locale.

\n", "summary" : "

Parses a date from a string in the current locale.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "input", "type" : "xs:string", "occurence" : null, "description" : "
The string to parse.
" }, { "name" : "format", "type" : "xs:string", "occurence" : null, "description" : "
The format string containing zero or more conversion specifications and ordinary characters. All ordinary characters are matched exactly with the buffer; all whitespace characters match any amount of whitespace in the buffer.
" } ], "returns" : { "type" : "xs:date", "description" : "Returns an xs:date." }, "errors" : [ "datetime:INVALID_SPECIFICATION if $format contains an invalid conversion specification.", "datetime:INSUFFICIENT_BUFFER if $input is insufficient for $format.", "datetime:INVALID_VALUE if $input contains an invalid value for a conversion specification.", "datetime:LITERAL_MISMATCH if there is a literal characer mismatch between $input and $format.", "datetime:INCOMPLETE_DATE_OR_TIME if the date is incomplete." ] }, { "arity" : 3, "name" : "parse-date", "qname" : "datetime:parse-date", "signature" : "($input as xs:string, $format as xs:string, $locale as xs:string) as xs:date external", "description" : "

Parses a date from a string in the given locale.

\n", "summary" : "

Parses a date from a string in the given locale.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "input", "type" : "xs:string", "occurence" : null, "description" : "
The string to parse.
" }, { "name" : "format", "type" : "xs:string", "occurence" : null, "description" : "
The format string containing zero or more conversion specifications and ordinary characters. All ordinary characters are matched exactly with the buffer; all whitespace characters match any amount of whitespace in the buffer.
" }, { "name" : "locale", "type" : "xs:string", "occurence" : null, "description" : "
The locale to use.
" } ], "returns" : { "type" : "xs:date", "description" : "Returns an xs:date." }, "errors" : [ "datetime:INVALID_SPECIFICATION if $format contains an invalid conversion specification.", "datetime:INSUFFICIENT_BUFFER if $input is insufficient for $format.", "datetime:INVALID_VALUE if $input contains an invalid value for a conversion specification.", "datetime:LITERAL_MISMATCH if there is a literal characer mismatch between $input and $format.", "datetime:INCOMPLETE_DATE_OR_TIME if the date is incomplete.", "datetime:INVALID_LOCALE if $locale is in an invalid format.", "datetime:UNKNOWN_LOCALE if $locale is unknown.", "datetime:UNSUPPORTED_LOCALE if $locale is unsupported by the operating system." ] }, { "arity" : 2, "name" : "parse-dateTime", "qname" : "datetime:parse-dateTime", "signature" : "($input as xs:string, $format as xs:string) as xs:dateTime external", "description" : "

Parses a dateTime from a string in the current locale.

\n", "summary" : "

Parses a dateTime from a string in the current locale.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "input", "type" : "xs:string", "occurence" : null, "description" : "
The string to parse.
" }, { "name" : "format", "type" : "xs:string", "occurence" : null, "description" : "
The format string containing zero or more conversion specifications and ordinary characters. All ordinary characters are matched exactly with the buffer; all whitespace characters match any amount of whitespace in the buffer.
" } ], "returns" : { "type" : "xs:dateTime", "description" : "Returns an xs:dateTime." }, "errors" : [ "datetime:INVALID_SPECIFICATION if $format contains an invalid conversion specification.", "datetime:INSUFFICIENT_BUFFER if $input is insufficient for $format.", "datetime:INVALID_VALUE if $input contains an invalid value for a conversion specification.", "datetime:LITERAL_MISMATCH if there is a literal characer mismatch between $input and $format.", "datetime:INCOMPLETE_DATE_OR_TIME if either the date or time is incomplete." ] }, { "arity" : 3, "name" : "parse-dateTime", "qname" : "datetime:parse-dateTime", "signature" : "($input as xs:string, $format as xs:string, $locale as xs:string) as xs:dateTime external", "description" : "

Parses a dateTime from a string in the given locale.

\n", "summary" : "

Parses a dateTime from a string in the given locale.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "input", "type" : "xs:string", "occurence" : null, "description" : "
The string to parse.
" }, { "name" : "format", "type" : "xs:string", "occurence" : null, "description" : "
The format string containing zero or more conversion specifications and ordinary characters. All ordinary characters are matched exactly with the buffer; all whitespace characters match any amount of whitespace in the buffer.
" }, { "name" : "locale", "type" : "xs:string", "occurence" : null, "description" : "
The locale to use.
" } ], "returns" : { "type" : "xs:dateTime", "description" : "Returns an xs:dateTime." }, "errors" : [ "datetime:INVALID_SPECIFICATION if $format contains an invalid conversion specification.", "datetime:INSUFFICIENT_BUFFER if $input is insufficient for $format.", "datetime:INVALID_VALUE if $input contains an invalid value for a conversion specification.", "datetime:LITERAL_MISMATCH if there is a literal characer mismatch between $input and $format.", "datetime:INCOMPLETE_DATE_OR_TIME if either the date or time is incomplete.", "datetime:INVALID_LOCALE if $locale is in an invalid format.", "datetime:UNKNOWN_LOCALE if $locale is unknown.", "datetime:UNSUPPORTED_LOCALE if $locale is unsupported by the operating system." ] }, { "arity" : 2, "name" : "parse-time", "qname" : "datetime:parse-time", "signature" : "($input as xs:string, $format as xs:string) as xs:time external", "description" : "

Parses a time from a string in the current locale.

\n", "summary" : "

Parses a time from a string in the current locale.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "input", "type" : "xs:string", "occurence" : null, "description" : "
The string to parse.
" }, { "name" : "format", "type" : "xs:string", "occurence" : null, "description" : "
The format string containing zero or more conversion specifications and ordinary characters. All ordinary characters are matched exactly with the buffer; all whitespace characters match any amount of whitespace in the buffer.
" } ], "returns" : { "type" : "xs:time", "description" : "Returns an xs:time." }, "errors" : [ "datetime:INVALID_SPECIFICATION if $format contains an invalid conversion specification.", "datetime:INSUFFICIENT_BUFFER if $input is insufficient for $format.", "datetime:INVALID_VALUE if $input contains an invalid value for a conversion specification.", "datetime:LITERAL_MISMATCH if there is a literal characer mismatch between $input and $format.", "datetime:INCOMPLETE_DATE_OR_TIME if the hour has not been parsed." ] }, { "arity" : 3, "name" : "parse-time", "qname" : "datetime:parse-time", "signature" : "($input as xs:string, $format as xs:string, $locale as xs:string) as xs:time external", "description" : "

Parses a time from a string in the given locale.

\n", "summary" : "

Parses a time from a string in the given locale.

", "annotation_str" : "", "annotations" : [ ], "updating" : false, "parameters" : [ { "name" : "input", "type" : "xs:string", "occurence" : null, "description" : "
The string to parse.
" }, { "name" : "format", "type" : "xs:string", "occurence" : null, "description" : "
The format string containing zero or more conversion specifications and ordinary characters. All ordinary characters are matched exactly with the buffer; all whitespace characters match any amount of whitespace in the buffer.
" }, { "name" : "locale", "type" : "xs:string", "occurence" : null, "description" : "
The locale to use.
" } ], "returns" : { "type" : "xs:time", "description" : "Returns an xs:time." }, "errors" : [ "datetime:INVALID_SPECIFICATION if $format contains an invalid conversion specification.", "datetime:INSUFFICIENT_BUFFER if $input is insufficient for $format.", "datetime:INVALID_VALUE if $input contains an invalid value for a conversion specification.", "datetime:LITERAL_MISMATCH if there is a literal characer mismatch between $input and $format.", "datetime:INCOMPLETE_DATE_OR_TIME if the hour has not been parsed.", "datetime:INVALID_LOCALE if $locale is in an invalid format.", "datetime:UNKNOWN_LOCALE if $locale is unknown.", "datetime:UNSUPPORTED_LOCALE if $locale is unsupported by the operating system." ] }, { "arity" : 0, "name" : "timestamp", "qname" : "datetime:timestamp", "signature" : "() as xs:long external", "description" : "

Gets the the number of milliseconds since epoch.

\n", "summary" : "

Gets the the number of milliseconds since epoch.

", "annotation_str" : " %an:nondeterministic", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "nondeterministic", "value" : "" } ], "updating" : false, "parameters" : [ ], "returns" : { "type" : "xs:long", "description" : "the said number of milliseconds." }, "errors" : [ ] }, { "arity" : 0, "name" : "utc-offset", "qname" : "datetime:utc-offset", "signature" : "() as xs:long external", "description" : "

Gets the offset of the current timezone from Universal time.

\n", "summary" : "

Gets the offset of the current timezone from Universal time.

", "annotation_str" : " %an:nondeterministic", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "nondeterministic", "value" : "" } ], "updating" : false, "parameters" : [ ], "returns" : { "type" : "xs:long", "description" : "the offset in seconds with positive values being east of the prime meridian." }, "errors" : [ ] } ], "variables" : [ ] }