2013-12-04T01:28:38.942159+01:001.0http://zorba.io/modules/excel/datetimedatetime This is a library module offering the same set of functions
defined by Microsoft Excel.
Sorin NasoiExcel Documentation: Datetime FunctionsZorba/Excel/Datetimexquery3.0utf-8http://zorba.io/modules/excel/text Import excel-text module functions.
The day of the week, from a date.
$date the date.the day of the week as a number, where from 0 (Sunday) to 6 (Saturday).excel-datetime:day-of-weekdeclare %private function excel-datetime:day-of-week($date as xs:anyAtomicType?) as xs:integer?datexs:anyAtomicTypexs:integer?http://www.w3.org/2001/XMLSchemadatehttp://www.w3.org/2001/XMLSchemadayTimeDurationhttp://www.w3.org/2001/XMLSchemaintegerhttp://www.w3.org/2005/xpath-functionsempty Tests if a year is leap or not.
$date the date.true if the year part of the supplied $date is a leap year, false otherwise.excel-datetime:is-leap-yeardeclare %private function excel-datetime:is-leap-year($date as xs:date) as xs:booleandatexs:datexs:booleanhttp://www.w3.org/2005/xpath-functionsyear-from-date Returns the number of days between two dates based on a 360-day year.
$start_date the start date.$end_date the end date.The number of days between two dates based on a 360-day year (twelve 30-day months), which is used in some accounting calculations. Use this function to help compute payments if your accounting system is based on twelve 30-day months. The metod used is U.S. (NASD). If the starting date is the last day of a month, it becomes equal to the 30th of the same month. If the ending date is the last day of a month and the starting date is earlier than the 30th of a month, the ending date becomes equal to the 1st of the next month; otherwise the ending date becomes equal to the 30th of the same month.http://office.microsoft.com/en-us/excel/HP052090471033.aspxexcel-datetime:days360declare function excel-datetime:days360($start_date as xs:date, $end_date as xs:date) as xs:integerstart_datexs:dateend_datexs:datexs:integerhttp://www.w3.org/2005/xpath-functionsfalsehttp://zorba.io/modules/excel/datetimedays360 Returns the number of days between two dates based on a 360-day year.
$start_date the start date.$end_date the end date.$method if false then US/NASD Method is used, otherwise the European Method is used.The number of days between two dates based on a 360-day year (twelve 30-day months), which is used in some accounting calculations. Use this function to help compute payments if your accounting system is based on twelve 30-day months. The European Method (30E/360) - If either date A or B falls on the 31st of the month, that date will be changed to the 30th; - Where date B falls on the last day of February, the actual date B will be used. The US/NASD Method (30US/360) - If both date A and B fall on the last day of February, then date B will be changed to the 30th. - If date A falls on the 31st of a month or last day of February, then date A will be changed to the 30th. - If date A falls on the 30th of a month after applying (2) above and date B falls on the 31st of a month, then date B will be changed to the 30th.http://office.microsoft.com/en-us/excel/HP052090471033.aspxexcel-datetime:days360declare function excel-datetime:days360($start_date as xs:date, $end_date as xs:date, $method as xs:boolean) as xs:integerstart_datexs:dateend_datexs:datemethodxs:booleanxs:integerhttp://www.w3.org/2005/xpath-functionsday-from-datehttp://www.w3.org/2005/xpath-functionsdays-from-durationhttp://www.w3.org/2005/xpath-functionsmonth-from-datehttp://www.w3.org/2005/xpath-functionstruehttp://www.w3.org/2005/xpath-functionsyear-from-datehttp://zorba.io/modules/excel/datetimedatehttp://zorba.io/modules/excel/datetimeis-leap-year Returns the hour of a time value.
$time the time.The hour of a time value. The hour is as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.).http://office.microsoft.com/en-us/excel/HP052091151033.aspxexcel-datetime:hourdeclare function excel-datetime:hour($time as xs:time) as xs:integer?timexs:timexs:integer?http://www.w3.org/2005/xpath-functionshours-from-time Returns the minutes of a time value.
$time the time.The minutes of a time value. The minute is given as an integer, ranging from 0 to 59.http://office.microsoft.com/en-us/excel/HP052091781033.aspxexcel-datetime:minutedeclare function excel-datetime:minute($time as xs:time) as xs:integer?timexs:timexs:integer?http://www.w3.org/2005/xpath-functionsminutes-from-time Returns the month of a $date.
$date the date.the month of a $date. The month is given as an integer, ranging from 1 (January) to 12 (December).http://office.microsoft.com/en-us/excel/HP052091841033.aspxexcel-datetime:monthdeclare function excel-datetime:month($date as xs:date) as xs:integer?datexs:datexs:integer?http://www.w3.org/2005/xpath-functionsmonth-from-date Returns the seconds of a $time value.
$time the time.The seconds of a $time value. The second is given as an integer in the range 0 (zero) to 59.http://office.microsoft.com/en-us/excel/HP052092511033.aspxexcel-datetime:seconddeclare function excel-datetime:second($time as xs:time) as xs:decimal?timexs:timexs:decimal?http://www.w3.org/2005/xpath-functionsseconds-from-time Returns the day of a $date, represented by a serial number.
$date the date.The day of a $date, represented by a serial number. The day is given as an integer ranging from 1 to 31.http://office.microsoft.com/en-us/excel/HP052090461033.aspxexcel-datetime:daydeclare function excel-datetime:day($date as xs:date) as xs:integer?datexs:datexs:integer?http://www.w3.org/2005/xpath-functionsday-from-date Returns the year corresponding to a date.
$date the date.The year corresponding to a date.http://office.microsoft.com/en-us/excel/HP052093431033.aspxexcel-datetime:yeardeclare function excel-datetime:year($date as xs:date) as xs:integer?datexs:datexs:integer?http://www.w3.org/2005/xpath-functionsyear-from-date Returns the current date.
The current date.http://www.w3.org/TR/xquery-operators/#func-current-dateexcel-datetime:todaydeclare function excel-datetime:today() as xs:date?xs:date?http://www.w3.org/2005/xpath-functionscurrent-date Returns the current date and time.
The current date and time.http://www.w3.org/TR/xquery-operators/#func-current-dateTimeexcel-datetime:nowdeclare function excel-datetime:now() as xs:dateTime?xs:dateTime?http://www.w3.org/2005/xpath-functionscurrent-dateTime Constructs a date given the hours, months and days.
$year the year$month the month$day the dayA date given the hours, months and dayshttp://office.microsoft.com/en-us/excel/HP052090421033.aspxsexcel-datetime:datedeclare function excel-datetime:date($year as xs:integer, $month as xs:integer, $day as xs:integer) as xs:date?yearxs:integermonthxs:integerdayxs:integerxs:date?http://www.w3.org/2001/XMLSchemadatehttp://www.w3.org/2005/xpath-functionsstring-joinhttp://zorba.io/modules/excel/textpad-integer-to-length Constructs a time given the hours, minutes and seconds.
$hour the hour.$minute the minute.$second the second.A time given the hours, minutes and seconds.http://office.microsoft.com/en-us/excel/HP052093151033.aspxexcel-datetime:timedeclare function excel-datetime:time($hour as xs:integer, $minute as xs:integer, $second as xs:integer) as xs:time?hourxs:integerminutexs:integersecondxs:integerxs:time?http://www.w3.org/2001/XMLSchematimehttp://www.w3.org/2005/xpath-functionsstring-joinhttp://zorba.io/modules/excel/textpad-integer-to-length Returns the day of the week corresponding to a $date.
$date the date.The day of the week corresponding to a $date. The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday).http://office.microsoft.com/en-us/excel/HP052093151033.aspxexcel-datetime:weekdaydeclare function excel-datetime:weekday($date as xs:date) as xs:integer?datexs:datexs:integer?http://zorba.io/modules/excel/datetimeweekday Returns the day of the week corresponding to a $date depending on $return_type.
$date the date.$return_type 1 for Numbers 1 (Sunday) through 7 (Saturday). 2 for Numbers 1 (Monday) through 7 (Sunday). 3 for Numbers 0 (Monday) through 6 (Sunday).The day of the week corresponding to a $date depending on $return_type.excel-err:Value if $return_type is outside the range [1,3].http://office.microsoft.com/en-us/excel/HP052093361033.aspxexcel-datetime:weekdaydeclare function excel-datetime:weekday($date as xs:date, $return_type as xs:integer) as xs:integer?datexs:datereturn_typexs:integerxs:integer?http://www.w3.org/2005/xpath-functionsQNamehttp://www.w3.org/2005/xpath-functionserrorhttp://zorba.io/modules/excel/datetimeday-of-week Returns the number of whole working days between $start_date and $end_date.
$start_date the start date.$end_date the end date.The number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays. Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days worked during a specific term.http://office.microsoft.com/en-us/excel/HP052091901033.aspxexcel-datetime:networkdaysdeclare function excel-datetime:networkdays($start_date as xs:date, $end_date as xs:date) as xs:integer*start_datexs:dateend_datexs:datexs:integer*http://zorba.io/modules/excel/datetimenetworkdays Returns the number of whole working days between $start_date and $end_date.
$start_date the start date.$end_date the end date.$holidays one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays.The number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays. Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days worked during a specific term.http://office.microsoft.com/en-us/excel/HP052091901033.aspxexcel-datetime:networkdaysdeclare function excel-datetime:networkdays($start_date as xs:date, $end_date as xs:date, $holidays as xs:date*) as xs:integer*start_datexs:dateend_datexs:dateholidaysxs:datexs:integer*http://www.w3.org/2005/xpath-functionscounthttp://www.w3.org/2005/xpath-functionsdays-from-durationhttp://zorba.io/modules/excel/datetimeday-of-week