public final class Date extends Object
Modifier and Type | Method and Description |
---|---|
static String |
add(XPathContext context,
String datetimeIn,
String durationIn)
The date:add function returns the date/time resulting from adding a duration to a date/time.
|
String |
addDuration(XPathContext context,
String duration0,
String duration1)
The date:add-duration function returns the duration resulting from adding two durations together.
|
static String |
date(XPathContext context)
The date:date function returns the current date.
|
static String |
date(XPathContext context,
String datetimeIn)
The date:date function returns the date specified in the date/time string given
as the argument.
|
static String |
dateTime(XPathContext context)
The date:date-time function returns the current date and time as a date/time string.
|
static String |
dayAbbreviation(XPathContext context)
Return the day of the week given in the current date as an English day abbreviation:
one of 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', or 'Sat'.
|
static String |
dayAbbreviation(XPathContext context,
String dateTime)
Return the day of the week given in a date as an English day abbreviation:
one of 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', or 'Sat'.
|
static double |
dayInMonth(XPathContext context)
Return the day number of the current date within the month
|
static double |
dayInMonth(XPathContext context,
String dateTime)
Return the day number of a specified date within the month
|
static double |
dayInWeek(XPathContext context)
Return the day of the week in the current date as a number.
|
static double |
dayInWeek(XPathContext context,
String dateTime)
Return the day of the week given in a date as a number.
|
static double |
dayInYear(XPathContext context)
Return the day number of the current date within the year
|
static double |
dayInYear(XPathContext context,
String dateTime)
Return the day number of a specified date within the year
|
static String |
dayName(XPathContext context)
Return the day of the week given in the current date as an English day name:
one of 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday' or 'Friday'.
|
static String |
dayName(XPathContext context,
String dateTime)
Return the day of the week given in a date as an English day name:
one of 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday' or 'Friday'.
|
static double |
dayOfWeekInMonth(XPathContext context)
Return the day-of-the-week in a month of the current date as a number
(for example 3 for the 3rd Tuesday in May).
|
static double |
dayOfWeekInMonth(XPathContext context,
String dateTime)
Return the day-of-the-week in a month of a date as a number
(for example 3 for the 3rd Tuesday in May).
|
static String |
difference(XPathContext context,
String dateLeftIn,
String dateRightIn)
The date:difference function returns the duration between the first date and the second date.
|
static String |
duration(double seconds)
The date:duration function returns a duration string representing the number of seconds
specified by the argument string.
|
static double |
hourInDay(XPathContext context)
Return the current hour of the day
|
static double |
hourInDay(XPathContext context,
String dateTime)
Return the hour of the day in the specified date or date/time
|
static boolean |
leapYear(XPathContext context)
Returns true if the current year is a leap year
|
static boolean |
leapYear(XPathContext context,
String dateTime)
Return true if the year specified in the date/time string
given as the argument is a leap year.
|
static double |
minuteInHour(XPathContext context)
Return the current minute of the hour
|
static double |
minuteInHour(XPathContext context,
String dateTime)
Return the minute of the hour in the specified date or date/time
|
static String |
monthAbbreviation(XPathContext context)
Return the month abbreviation from the current date.
|
static String |
monthAbbreviation(XPathContext context,
String date)
Return the month abbreviation from a date.
|
static double |
monthInYear(XPathContext context)
Return the month number from the current date.
|
static double |
monthInYear(XPathContext context,
String dateTime)
Return the month number from a date.
|
static String |
monthName(XPathContext context)
Return the month name from the current date.
|
static String |
monthName(XPathContext context,
String date)
Return the month name from a date.
|
static double |
secondInMinute(XPathContext context)
Return the current second of the minute
|
static double |
secondInMinute(XPathContext context,
String dateTime)
Return the second of the minute in the specified date or date/time
|
static double |
seconds(XPathContext context)
Return the number of seconds since 1 Jan 1970
|
static double |
seconds(XPathContext context,
String datetimeIn)
The date:seconds function returns the number of seconds specified by the argument string.
|
static String |
sum(XPathContext context,
SequenceIterator nodes)
The date:sum function adds a set of durations together.
|
static String |
time(XPathContext context)
The date:time function returns the current time.
|
static String |
time(XPathContext context,
String dateTime)
The date:time function returns the time specified in the date/time string given as the
argument.
|
static double |
weekInMonth(XPathContext context)
Return the ISO week number of the current date within the month
|
static double |
weekInMonth(XPathContext context,
String dateTime)
Return the week number of a specified date within the month
(Note, this function is underspecified in EXSLT)
|
static double |
weekInYear(XPathContext context)
Return the ISO week number of the current date
|
static double |
weekInYear(XPathContext context,
String dateTime)
Return the ISO week number of a specified date within the year
(Note, this returns the ISO week number: the result in EXSLT is underspecified)
|
static double |
year(XPathContext context)
The date:year function returns the current year.
|
static double |
year(XPathContext context,
String datetimeIn)
The date:year function returns the year of a date as a number.
|
public static String dateTime(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static String date(XPathContext context, String datetimeIn)
public static String date(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static String time(XPathContext context, String dateTime)
dateTime
- must start with [+|-]CCYY-MM-DDThh:mm:sspublic static String time(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static double year(XPathContext context, String datetimeIn)
Note: although not specifically permitted in the EXSLT specification, the Saxon implementation also allows the input value to contain a timezone
XPathException
public static double year(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static boolean leapYear(XPathContext context, String dateTime) throws XPathException
dateTime
- a dateTime as a stringXPathException
public static boolean leapYear(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static double monthInYear(XPathContext context, String dateTime)
dateTime
- a dateTime as a stringpublic static double monthInYear(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static String monthName(XPathContext context, String date)
date
- the date/time as a stringpublic static String monthName(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static String monthAbbreviation(XPathContext context, String date)
date
- The date must start with either "CCYY-MM" or "--MM"public static String monthAbbreviation(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static double weekInYear(XPathContext context, String dateTime) throws XPathException
dateTime
- the current date starting CCYY-MM-DDXPathException
public static double weekInYear(XPathContext context) throws XPathException
context
- the XPath dynamic context
(Note, this returns the ISO week number: the result in EXSLT is underspecified)XPathException
public static double weekInMonth(XPathContext context, String dateTime) throws XPathException
dateTime
- the date starting CCYY-MM-DDXPathException
public static double weekInMonth(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static double dayInYear(XPathContext context, String dateTime) throws XPathException
dateTime
- the date starting with CCYY-MM-DDXPathException
public static double dayInYear(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static double dayInMonth(XPathContext context, String dateTime) throws XPathException
dateTime
- must start with CCYY-MM-DD, or --MM-DD, or ---DDXPathException
public static double dayInMonth(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static double dayOfWeekInMonth(XPathContext context, String dateTime) throws XPathException
dateTime
- must start with CCYY-MM-DDXPathException
public static double dayOfWeekInMonth(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static double dayInWeek(XPathContext context, String dateTime) throws XPathException
dateTime
- must start with CCYY-MM-DDXPathException
public static double dayInWeek(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static String dayName(XPathContext context, String dateTime) throws XPathException
dateTime
- must start with CCYY-MM-DDXPathException
public static String dayName(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static String dayAbbreviation(XPathContext context, String dateTime) throws XPathException
dateTime
- must start with CCYY-MM-DDXPathException
public static String dayAbbreviation(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static double hourInDay(XPathContext context, String dateTime)
dateTime
- must start with CCYY-MM-DDThh:mm:ss or hh:mm:sspublic static double hourInDay(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static double minuteInHour(XPathContext context, String dateTime)
dateTime
- must start with CCYY-MM-DDThh:mm:ss or hh:mm:sspublic static double minuteInHour(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static double secondInMinute(XPathContext context, String dateTime) throws XPathException
dateTime
- must start with CCYY-MM-DDThh:mm:ss or hh:mm:ssXPathException
public static double secondInMinute(XPathContext context) throws XPathException
context
- the XPath dynamic contextXPathException
public static String add(XPathContext context, String datetimeIn, String durationIn) throws XPathException
XPathException
public static String sum(XPathContext context, SequenceIterator nodes) throws XPathException
XPathException
public String addDuration(XPathContext context, String duration0, String duration1)
public static String difference(XPathContext context, String dateLeftIn, String dateRightIn) throws XPathException
XPathException
public static String duration(double seconds)
public static double seconds(XPathContext context) throws XPathException
XPathException
public static double seconds(XPathContext context, String datetimeIn) throws XPathException
XPathException
Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.