datevalue(text
,format
?,locale
?)
Converts text to a date. Unless format is specified, the date must be represented using the ISO 8601 format (also used by W3C XML Schema Datatypes).
Date format format may be used to parse text using a localized format. Supported formats are described in http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html. The empty string ("") specifies the default format.
Locale locale may be used to specify how to interpret format format. Without locale argument locale, this format is interpreted using the current language of the XML document (typically specified using the standard xml:lang
attribute, but this can be configured).
Locales are specified using a standard 2-letter language code, optionally followed by a dash and a standard 2-letter country code. Examples: en, en-US, de, de-CH, etc.
Examples, (assume that the language of the XML document being edited is "en-US
" and that XMLmind XML Editor is running on a machine in France=GMT+1):
datevalue("1960-03-16Z") = March 16, 1960 UTC1960-03-16Z
datevalue("03/16/60", "") = 1960-03-15Z
datevalue("03/16/60 UTC", "MM/dd/yy z") = 1960-03-16Z
datevalue("16/03/60", "", "fr") =1960-03-15Z
datevalue("16 Mars 1960", "dd MMMM yyyy", "fr") = 1960-03-15Z
datevalue can also be used to convert a number to a date. In such case, format must not be specified. A date can be represented by the number of seconds since January 1, 1970, 00:00:00 GMT.
Example: datevalue(-309139200.000) = March 16, 1960 UTC
See also timevalue, datetimevalue, numbervalue, text.
timevalue(text
,format
?,locale
?)
Converts text to a time. Unless format is specified, the time must be represented using the ISO 8601 format (also used by W3C XML Schema Datatypes).
Date/time format format may be used to parse text using a localized format. Supported formats are described in http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html. The empty string ("") specifies the default format.
Locale locale may be used to specify how to interpret format format. Without locale argument locale, this format is interpreted using the current language of the XML document (typically specified using the standard xml:lang
attribute, but this can be configured).
Locales are specified using a standard 2-letter language code, optionally followed by a dash and a standard 2-letter country code. Examples: en, en-US, de, de-CH, etc.
Examples, (assume that the language of the XML document being edited is "en-US
" and that XMLmind XML Editor is running on a machine in France=GMT+1):
timevalue("13:30:00Z") = 13:30:00Z
timevalue("13:30:00") = 12:30:00Z
timevalue("01:30 pm", "") = 12:30:00Z
timevalue("01:30:00 pm UTC", "hh:mm:ss a z") = 13:30:00Z
timevalue("13:30", "", "fr") = 12:30:00Z
timevalue("13:30:00.123", "HH:mm:ss.SSS", "fr") = 12:30:00.123Z
timevalue can also be used to convert a number to a time. In such case, format must not be specified. A time can be represented by the number of seconds since 00:00:00 GMT.
Example: timevalue(13.5*3600) = T13:30:00Z
See also datevalue, datetimevalue, numbervalue, text.
datetimevalue(text
,format
?,locale
?)
Converts text to a date+time. Unless format is specified, the date+time must be represented using the ISO 8601 format (also used by W3C XML Schema Datatypes).
Date/time format format may be used to parse text using a localized format. Supported formats are described in http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html. The empty string ("") specifies the default format.
Locale locale may be used to specify how to interpret format format. Without locale argument locale, this format is interpreted using the current language of the XML document (typically specified using the standard xml:lang
attribute, but this can be configured).
Locales are specified using a standard 2-letter language code, optionally followed by a dash and a standard 2-letter country code. Examples: en, en-US, de, de-CH, etc.
Examples, (assume that the language of the XML document being edited is "en-US
" and that XMLmind XML Editor is running on a machine in France=GMT+1):
datetimevalue("1960-03-16T13:30:00Z") = 1960-03-16T13:30:00Z
datetimevalue("03/16/1960 01:30 pm", "") = 1960-03-16T12:30:00Z
datetimevalue("03/16/60 01:30:00 pm UTC", "MM/dd/yy hh:mm:ss a z") = 1960-03-16T13:30:00Z
datetimevalue("16/03/60 13:30", "", "fr") =1960-03-16T12:30:00Z
datetimevalue("13:30:00, 16 Mars 1960", "HH:mm:ss, dd MM yyy", "fr") = 1960-03-16T12:30:00Z
datetimevalue can also be used to convert a number to a date+time. In such case, format must not be specified. A date+time can be represented by the number of seconds since January 1, 1970, 00:00:00 GMT.
Example: datetimevalue(-309139200 + 13.5*3600) = 1960-03-16T13:30:00Z
See also datevalue, timevalue, numbervalue, text.
date(year
,month
,day
,time_zone
?)
Returns a date representing specified year, month, day. Unless time_zone is specified, the local time zone is used.
Examples (XMLmind XML Editor running on a machine in France=GMT+1):
date(1960, 03, 16) = 1960-03-15Z
date(1960, 03, 16, "GMT+01:00") = 1960-03-15Z
date(1960, 03, 16, "GMT") = 1960-03-16Z
Specifying time zones is explained in this document http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimeZone.html.
See also datevalue, timevalue, datetimevalue, time, datetime.
time(hour
,minute
,second
,time_zone
?)
Returns a time representing specified hour, minute, second. Unless time_zone is specified, the local time zone is used.
Examples (XMLmind XML Editor running on a machine in France=GMT+1):
time(13, 30, 45) = 12:30:45Z
time(13, 30, 45, "GMT-01:00") = 14:30:45Z
time(13, 30, 45.123, "GMT") = 13:30:45Z (note that seconds have been rounded)
Specifying time zones is explained in this document http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimeZone.html.
See also datevalue, timevalue, datetimevalue, date, datetime.
datetime(year
,month
,day
,hour
,minute
,second
,time_zone
?)
Returns a date+time representing specified year, month, day, hour, minute, second. Unless time_zone is specified, the local time zone is used.
Examples (XMLmind XML Editor running on a machine in France=GMT+1):
datetime(1960, 03, 16, 13, 30, 45) = 1960-03-16T12:30:45Z
datetime(1960, 03, 16, 13, 30, 45, "GMT-01:00") = 1960-03-16T14:30:45Z
datetime(1960, 03, 16, 13, 30, 45, "GMT") = 1960-03-16T13:30:45Z
Specifying time zones is explained in this document http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimeZone.html.
See also datevalue, timevalue, datetimevalue, date, time.
year(date
)
Returns the year in specified date, a date or date+time. This function uses the local calendar (i.e. local time zone) to compute its result.
Examples (XMLmind XML Editor running on a machine in France=GMT+1):
year(date(1960,03,16)) = 1960
year(date(1960,03,16, "UTC")) = 1960
year("1960-03-16T13:30:45+01:00") = 1960
year("1960-12-31T23:00:00Z") = 1961
month(date
)
Returns the month in specified date, a date or date+time. This function uses the local calendar (i.e. local time zone) to compute its result.
Examples (XMLmind XML Editor running on a machine in France=GMT+1):
month(date(1960,03,16)) = 3
month(date(1960,03,16, "UTC")) = 3
month("1960-03-16T13:30:45+01:00") = 3
month("1960-03-31T23:00:00Z") = 4
day(date
)
Returns the day in specified date, a date or date+time. This function uses the local calendar (i.e. local time zone) to compute its result.
Examples (XMLmind XML Editor running on a machine in France=GMT+1):
day(date(1960,03,16)) = 16
day(date(1960,03,16, "UTC")) = 16
day("1960-03-16T13:30:45+01:00") = 16
day("1960-03-16T23:00:00Z") = 17
weekday(date
,option
?)
Returns the day in specified date, a date or date+time. This function uses the local calendar (i.e. local time zone) to compute its result.
Option | Description |
1 (default) | Returns 1 for Sunday to 7 for Saturday. |
2 | Returns 1 for Monday to 7 for Sunday |
3 | Returns 0 for Monday to 6 for Sunday |
Examples (XMLmind XML Editor running on a machine in France=GMT+1):
weekday(date(1960,03,16)) = 4 (Wednesday)
weekday(date(1960,03,16, "UTC")) = 4
weekday("1960-03-16T13:30:45+01:00") = 4
weekday("1960-03-16T23:00:00Z") = 5 (Thursday)
With option=2:
weekday(date(1960,03,16), 2) = 3 (Wednesday)
weekday(date(1960,03,16, "UTC"), 2) = 3
weekday("1960-03-16T13:30:45+01:00", 2) = 3
weekday("1960-03-16T23:00:00Z", 2) = 4 (Thursday)
With option=3:
weekday(date(1960,03,16), 3) = 2 (Wednesday)
weekday(date(1960,03,16, "UTC"), 3) = 2
weekday("1960-03-16T13:30:45+01:00", 3) = 2
weekday("1960-03-16T23:00:00Z", 3) = 3 (Thursday)
hour(date
)
Returns the hours in specified date, a time or date+time. This function uses the local calendar (i.e. local time zone) to compute its result.
Examples (XMLmind XML Editor running on a machine in France=GMT+1):
hour(time(13,30,45)) = 13
hour(time(13,30,45, "UTC")) = 14
hour("1960-03-16T13:30:45+01:00") = 13
hour("1960-03-16T13:30:45.123") = 13
hour("1960-03-16T13:30:45.123Z") = 14
minute(date
)
Returns the minutes in specified date, a time or date+time. This function uses the local calendar (i.e. local time zone) to compute its result.
Examples (XMLmind XML Editor running on a machine in France=GMT+1):
minute(time(13,30,45)) = 30
minute("1960-03-16T13:30:45+01:00") = 30
second(date
)
Returns the seconds in specified date, a time or date+time. This function uses the local calendar (i.e. local time zone) to compute its result.
Examples (XMLmind XML Editor running on a machine in France=GMT+1):
second(time(13,30,45)) = 45
second("1960-03-16T13:30:45.123") = 45 (note that seconds are rounded)
today()
Returns current date. The time zone used is the local time zone.
Example (XMLmind XML Editor running on a machine in France=GMT+1): today() = 2004-10-15Z