|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.xalan.lib.ExsltDatetime
This class contains EXSLT dates and times extension functions. It is accessed by specifying a namespace URI as follows:
xmlns:datetime="http://exslt.org/dates-and-times"
The documentation for each function has been copied from the relevant
EXSLT Implementer page.
| Field Summary | |
(package private) static String |
d
|
(package private) static String |
dt
|
(package private) static String |
gd
|
(package private) static String |
gm
|
(package private) static String |
gmd
|
(package private) static String |
gy
|
(package private) static String |
gym
|
(package private) static String |
t
|
| Constructor Summary | |
ExsltDatetime()
|
|
| Method Summary | |
static XString |
date()
See above. |
static XString |
date(String datetimeIn)
The date:date function returns the date specified in the date/time string given as the argument. |
static XString |
dateTime()
The date:date-time function returns the current date and time as a date/time string. |
static XString |
dayAbbreviation()
See above. |
static XString |
dayAbbreviation(String datetimeIn)
The date:day-abbreviation function returns the abbreviation of the day of the week of a date. |
static XNumber |
dayInMonth()
See above. |
static XNumber |
dayInMonth(String datetimeIn)
The date:day-in-month function returns the day of a date as a number. |
static XNumber |
dayInWeek()
See above. |
static XNumber |
dayInWeek(String datetimeIn)
The date:day-in-week function returns the day of the week given in a date as a number. |
static XNumber |
dayInYear()
See above. |
static XNumber |
dayInYear(String datetimeIn)
The date:day-in-year function returns the day of a date in a year as a number. |
static XString |
dayName()
See above. |
static XString |
dayName(String datetimeIn)
The date:day-name function returns the full name of the day of the week of a date. |
static XNumber |
dayOfWeekInMonth()
See above. |
static XNumber |
dayOfWeekInMonth(String datetimeIn)
The date:day-of-week-in-month function returns the day-of-the-week in a month of a date as a number (e.g. 3 for the 3rd Tuesday in May). |
private static String |
formatDigits(int q)
Represent the hours and minutes with two-digit strings. |
private static String[] |
getEraDatetimeZone(String in)
Returns an array with the 3 components that a datetime input string may contain: - (for BC era), datetime, and zone. |
private static String |
getNameOrAbbrev(String format)
Get the full name or abbreviation for the current month or day (no input string). |
private static String |
getNameOrAbbrev(String in,
String[] formatsIn,
String formatOut)
Get the full name or abbreviation of the month or day. |
private static double |
getNumber(String in,
String[] formats,
int calField)
Parse the input string and return the corresponding calendar field number. |
private static int |
getZoneStart(String datetime)
Get the start of zone information if the input ends with 'Z' or +/-hh:mm. |
static XNumber |
hourInDay()
See above. |
static XNumber |
hourInDay(String datetimeIn)
The date:hour-in-day function returns the hour of the day as a number. |
static XBoolean |
leapYear()
See above. |
static XObject |
leapYear(String datetimeIn)
The date:leap-year function returns true if the year given in a date is a leap year. |
static XNumber |
minuteInHour()
See above. |
static XNumber |
minuteInHour(String datetimeIn)
The date:minute-in-hour function returns the minute of the hour as a number. |
static XString |
monthAbbreviation()
See above. |
static XString |
monthAbbreviation(String datetimeIn)
The date:month-abbreviation function returns the abbreviation of the month of a date. |
static XNumber |
monthInYear()
See above. |
static XNumber |
monthInYear(String datetimeIn)
The date:year function returns the month of a date as a number. |
static XString |
monthName()
See above. |
static XString |
monthName(String datetimeIn)
The date:month-name function returns the full name of the month of a date. |
static XNumber |
secondInMinute()
See above. |
static XNumber |
secondInMinute(String datetimeIn)
The date:second-in-minute function returns the second of the minute as a number. |
private static Date |
testFormats(String in,
String[] formats)
Attempt to parse an input string with the allowed formats, returning null if none of the formats work. |
static XString |
time()
See above. |
static XString |
time(String timeIn)
The date:time function returns the time specified in the date/time string given as the argument. |
static XNumber |
weekInYear()
See above. |
static XNumber |
weekInYear(String datetimeIn)
The date:week-in-year function returns the week of the year as a number. |
static XNumber |
year()
See above. |
static XNumber |
year(String datetimeIn)
The date:year function returns the year of a date as a number. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
static final String dt
static final String d
static final String gym
static final String gy
static final String gmd
static final String gm
static final String gd
static final String t
| Constructor Detail |
public ExsltDatetime()
| Method Detail |
public static XString dateTime()
private static String formatDigits(int q)
q - hrs or minutes.
public static XString date(String datetimeIn)
throws ParseException
ParseExceptionpublic static XString date()
public static XString time(String timeIn)
throws ParseException
ParseExceptionpublic static XString time()
public static XNumber year(String datetimeIn)
throws ParseException
ParseExceptionpublic static XNumber year()
public static XNumber monthInYear(String datetimeIn)
throws ParseException
ParseExceptionpublic static XNumber monthInYear()
public static XNumber weekInYear(String datetimeIn)
throws ParseException
ParseExceptionpublic static XNumber weekInYear()
public static XNumber dayInYear(String datetimeIn)
throws ParseException
ParseExceptionpublic static XNumber dayInYear()
public static XNumber dayInMonth(String datetimeIn)
throws ParseException
ParseExceptionpublic static XNumber dayInMonth()
public static XNumber dayOfWeekInMonth(String datetimeIn)
throws ParseException
ParseExceptionpublic static XNumber dayOfWeekInMonth()
public static XNumber dayInWeek(String datetimeIn)
throws ParseException
ParseExceptionpublic static XNumber dayInWeek()
public static XNumber hourInDay(String datetimeIn)
throws ParseException
ParseExceptionpublic static XNumber hourInDay()
public static XNumber minuteInHour(String datetimeIn)
throws ParseException
ParseExceptionpublic static XNumber minuteInHour()
public static XNumber secondInMinute(String datetimeIn)
throws ParseException
ParseExceptionpublic static XNumber secondInMinute()
public static XObject leapYear(String datetimeIn)
throws ParseException
ParseExceptionpublic static XBoolean leapYear()
public static XString monthName(String datetimeIn)
throws ParseException
ParseExceptionpublic static XString monthName()
public static XString monthAbbreviation(String datetimeIn)
throws ParseException
ParseExceptionpublic static XString monthAbbreviation()
public static XString dayName(String datetimeIn)
throws ParseException
ParseExceptionpublic static XString dayName()
public static XString dayAbbreviation(String datetimeIn)
throws ParseException
ParseExceptionpublic static XString dayAbbreviation()
private static String[] getEraDatetimeZone(String in)
private static int getZoneStart(String datetime)
private static Date testFormats(String in,
String[] formats)
throws ParseException
ParseException
private static double getNumber(String in,
String[] formats,
int calField)
throws ParseException
ParseException
private static String getNameOrAbbrev(String in,
String[] formatsIn,
String formatOut)
throws ParseException
ParseExceptionprivate static String getNameOrAbbrev(String format)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||