Class DateTimeUtil
- java.lang.Object
-
- de.uplanet.lucy.server.auxiliaries.datetime.DateTimeUtil
-
@VelocityVariable("DtUtil") @VelocityCallable("singleton") public final class DateTimeUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<Object>COMPARATOR_DATE_TIME_SORT_NULL_HIGHCompares two date/time objects with millisecond accuracy.static Comparator<Object>COMPARATOR_DATE_TIME_SORT_NULL_LOWCompares two date/time objects with millisecond accuracy.static StringDATE_TIME_FORMAT_1The formatyyyy-MM-dd HH:mm:ss.static StringDATE_TIME_FORMAT_2The formatyyyy-MM-dd HH:mm.static StringUTC_ISO_DATE_TIME_FORMATThe standard ISO UTC formatyyyy-MM-dd'T'HH:mm:ss'Z'.static StringUTC_ISO_DATE_TIME_FORMAT_MILLISThe standard ISO UTC format with millisecondsyyyy-MM-dd'T'HH:mm:ss.SSS'Z'.
-
Constructor Summary
Constructors Constructor Description DateTimeUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareNullHigh(Object p_lhs, Object p_rhs)Compares two date/time objects with millisecond accuracy.intcompareNullLow(Object p_lhs, Object p_rhs)Compares two date/time objects with millisecond accuracy.CalendarAwareDatedate(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute, int p_iSecond, int p_iMillisecond, TimeZone p_tz)Create a date object from date fields given in the specified time zone.CalendarAwareDatedate(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute, int p_iSecond, TimeZone p_tz)Create a date object from date fields given in the specified time zone.CalendarAwareDatedate(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute, TimeZone p_tz)Create a date object from date fields given in the specified time zone.CalendarAwareDatedate(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, TimeZone p_tz)Create a date object from date fields given in the specified time zone.CalendarAwareDatedate(int p_iYear, int p_iMonth, int p_iDay, TimeZone p_tz)Create a date object from date fields given in the specified time zone.CalendarAwareDatedate(int p_iYear, int p_iMonth, TimeZone p_tz)Create a date object from date fields given in the specified time zone.CalendarAwareDatedate(int p_iYear, TimeZone p_tz)Create a date object from date fields given in the specified time zone.StringdateToISOString(Object p_date)Get a string value that represents the instance in time represented by the given date object, without milliseconds.StringdateToISOStringWithMilliseconds(Object p_date)Get a string value that represents the instance in time represented by the given date object, including millisecondsStringformatDate(String p_strFormat, Object p_date, TimeZone p_tz)Format a date according to the given simple date format.StringformatDate(String p_strFormat, Object p_date, TimeZone p_tz, String p_strLocaleId)Format a date according to the given simple date format.CalendarAwareDategetAscensionDate(Object p_obj, TimeZone p_tz)Get the Ascension Day (Christi Himmelfahrt) date in the given year.CalendarAwareDategetAshWednesdayDate(Object p_obj, TimeZone p_tz)Get the Ash Wednesday (Aschermittwoch) date in the given year.CalendarAwareDategetCorpusChristiDate(Object p_obj, TimeZone p_tz)Get the Corpus Christi (Fronleichnam) date in the given year.StringgetDayOfWeekName(Number p_num)Get the day of week name by its number (1 = Sunday, ..., 7 = Saturday).StringgetDayOfWeekName(Number p_num, String p_strLocaleId)Get the day of week name by its number (1 = Sunday, ..., 7 = Saturday).StringgetDayOfWeekName(Object p_date, TimeZone p_tz)Get the name of the given day of week.StringgetDayOfWeekName(Object p_date, TimeZone p_tz, String p_strLocaleId)Get the name of the given day of week.StringgetDayOfWeekShortName(Number p_num)Get the day of week short name by its number (1 = Sun, ..., 7 = Sat).StringgetDayOfWeekShortName(Number p_num, String p_strLocaleId)Get the day of week short name by its number (1 = Sun, ..., 7 = Sat).StringgetDayOfWeekShortName(Object p_date, TimeZone p_tz)Get the short name of the given day of week.StringgetDayOfWeekShortName(Object p_date, TimeZone p_tz, String p_strLocaleId)Get the short name of the given day of week.DurationgetDifference(Object p_lhs, Object p_rhs)Get the time difference between the two objects.DurationgetDifferenceFromMilliseconds(long p_lTime)Ctreate a difference object for the given time difference.intgetDifferenceInDays(Object p_lhs, Object p_rhs, TimeZone p_tz)Get the time difference in full days between the two objects.longgetDifferenceInMilliseconds(Object p_lhs, Object p_rhs)Get the time difference in milliseconds between the two objects.intgetDifferenceInMonths(Object p_lhs, Object p_rhs, TimeZone p_tz)Get the time difference in full months between the two objects.intgetDifferenceInYears(Object p_lhs, Object p_rhs, TimeZone p_tz)Get the time difference in full years between the two objects.CalendarAwareDategetEasterDate(Object p_obj, TimeZone p_tz)Get the Easter (Ostersonntag) date in the given year.CalendarAwareDategetEasterMondayDate(Object p_obj, TimeZone p_tz)Get the Easter Monday (Ostermontag) date in the given year.CalendarAwareDategetGoodFridayDate(Object p_obj, TimeZone p_tz)Get the Good Friday (Karfreitag) date in the given year.intgetISO8601WeekNumber(int p_iYear, int p_iMonth, int p_iDay)Get the week number as defined in DIN 1355/ISO 8601.intgetISO8601WeekNumber(Object p_date, TimeZone p_tz)Get the week number as defined in DIN 1355/ISO 8601.CalendarAwareDategetISO8601WeekStart(int p_iYear, int p_iWeek, TimeZone p_tz)Get the beginning of the week as defined in ISO 8601.longgetLunationNumber(Object p_date)Get the Brown Lunation Number.CalendarAwareDategetMaundyThursdayDate(Object p_obj, TimeZone p_tz)Get the Maundy Thursday (Gründonnerstag) date in the given year.longgetMeeusLunationNumber(Object p_date)Get the Meeus Lunation Number.StringgetMonthName(Number p_num)Get the month name by its number (0 = January, ..., 11 = December).StringgetMonthName(Number p_num, String p_strLocaleId)Get the month name by its number (0 = January, ..., 11 = December).StringgetMonthName(Object p_date, TimeZone p_tz)Get the name of the given month.StringgetMonthName(Object p_date, TimeZone p_tz, String p_strLocaleId)Get the name of the given month.StringgetMonthShortName(Number p_num)Get the month short name by its number (0 = Jan, ..., 11 = Dec).StringgetMonthShortName(Number p_num, String p_strLocaleId)Get the month short name by its number (0 = Jan, ..., 11 = Dec).StringgetMonthShortName(Object p_date, TimeZone p_tz)Get the short name of the given month.StringgetMonthShortName(Object p_date, TimeZone p_tz, String p_strLocaleId)Get the short name of the given month.CalendarAwareDategetPenanceDayDate(Object p_obj, TimeZone p_tz)Get the Penance Day (Buß- und Bettag) date in the given year.CalendarAwareDategetPentecostDate(Object p_obj, TimeZone p_tz)Get the Pentecost date (Pfingstsonntag) in the given year.doublegetPhaseOfTheMoon(Object p_date)Get the phase of the moon.intgetQuarter(Object p_date, TimeZone p_tz)Get the quarter that contains the given date.TimeZonegetServerDefaultTimeZone()Get the default server time zone.CalendarAwareDategetShroveMondayDate(Object p_obj, TimeZone p_tz)Get the Shrove Monday (Rosenmontag) date in the given year.CalendarAwareDategetStartOfQuarter(Object p_date, TimeZone p_tz)Get the start of the quarter that contains the given date.CalendarAwareDategetStartOfWeek(Object p_obj, int p_iFirstDayOfWeek, TimeZone p_tz)Get the start of the week that contains the given date.TimeZonegetTimeZone(IUser p_user)Get the context time zone from the user, or, if not present, the default server time zone.TimeZonegetTimeZone(String p_strTimeZoneId)Get the specified time zone.CalendarAwareDategetWhitMondayDate(Object p_obj, TimeZone p_tz)Get the Whit Monday (Pfingstmontag) date in the given year.CalendarAwareDategetWhitSundayDate(Object p_obj, TimeZone p_tz)Get the Whit Sunday (Pfingstsonntag) date in the given year.booleanisFriday(Object p_date, TimeZone p_tz)booleanisLeapYear(int p_iYear)Determines if the given year is a leap year in the Gregorian Calendar.booleanisMonday(Object p_date, TimeZone p_tz)CalendarAwareDateisoStringToDate(String p_strDate)Parse a string of the formyyyy-MM-dd'T'HH:mm:ss'Z'oryyyy-MM-dd'T'HH:mm:ss.SSS'Z'as a date.CalendarAwareDateisoStringToDate(String p_strDate, TimeZone p_tz)Parse a string of the formyyyy-MM-dd'T'HH:mm:ss'Z'oryyyy-MM-dd'T'HH:mm:ss.SSS'Z'as a date.booleanisSameH(Object p_obj1, Object p_obj2, TimeZone p_tz)Check if the given objects reference the same hour.booleanisSameHM(Object p_obj1, Object p_obj2, TimeZone p_tz)Check if the given objects reference the same hour, and minute.booleanisSameHMS(Object p_obj1, Object p_obj2, TimeZone p_tz)Check if the given objects reference the same hour, minute, and second.booleanisSameHMSM(Object p_obj1, Object p_obj2, TimeZone p_tz)Check if the given objects reference the same hour, minute, second, and millisecond.booleanisSameY(Object p_obj1, Object p_obj2, TimeZone p_tz)Check if the given objects reference the same year.booleanisSameYM(Object p_obj1, Object p_obj2, TimeZone p_tz)Check if the given objects reference the same year, and month.booleanisSameYMD(Object p_obj1, Object p_obj2, TimeZone p_tz)Check if the given objects reference the same year, month, and day.booleanisSaturday(Object p_date, TimeZone p_tz)booleanisSunday(Object p_date, TimeZone p_tz)booleanisThursday(Object p_date, TimeZone p_tz)booleanisToday(Object p_obj, TimeZone p_tz)Check if the given object references the same year, month, and day as the current date.booleanisTuesday(Object p_date, TimeZone p_tz)booleanisWednesday(Object p_date, TimeZone p_tz)CalendarAwareDatenow(TimeZone p_tz)Create a date object with the current date and time.CalendarAwareDateparseDate(String p_strFormat, String p_strDate, TimeZone p_tzParse)Parse a string with the given format as a date in the given time zone.CalendarAwareDateparseDate(String p_strFormat, String p_strDate, TimeZone p_tzParse, String p_strLocaleId)Parse a string with the given format as a date in the given time zone.CalendarAwareDateparseDate(String p_strFormat, String p_strDate, TimeZone p_tzParse, TimeZone p_tzAssoc)Parse a string with the given format as a date in the given time zone.CalendarAwareDateparseDate(String p_strFormat, String p_strDate, TimeZone p_tzParse, TimeZone p_tzAssoc, String p_strLocaleId)Parse a string with the given format as a date in the given time zone.CalendarAwareDateparseUTCDate(String p_strFormat, String p_strDate)Parse a string with the given format as a date in the UTC time zone.CalendarAwareDateparseUTCDate(String p_strFormat, String p_strDate, String p_strLocaleId)Parse a string with the given format as a date in the UTC time zone.CalendarAwareDateparseUTCDate(String p_strFormat, String p_strDate, TimeZone p_tzAssoc)Parse a string with the given format as a date in the UTC time zone.CalendarAwareDateparseUTCDate(String p_strFormat, String p_strDate, TimeZone p_tzAssoc, String p_strLocaleId)Parse a string with the given format as a date in the UTC time zone.List<Object>sortNullHigh(List<Object> p_list)Sort the given list of date/time objects with millisecond accuracy.List<Object>sortNullLow(List<Object> p_list)Sort the given list of date/time objects with millisecond accuracy.CalendarAwareDateutc(int p_iYear)Create a date object from date fields given in UTC.CalendarAwareDateutc(int p_iYear, int p_iMonth)Create a date object from date fields given in UTC.CalendarAwareDateutc(int p_iYear, int p_iMonth, int p_iDay)Create a date object from date fields given in UTC.CalendarAwareDateutc(int p_iYear, int p_iMonth, int p_iDay, int p_iHour)Create a date object from date fields given in UTC.CalendarAwareDateutc(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute)Create a date object from date fields given in UTC.CalendarAwareDateutc(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute, int p_iSecond)Create a date object from date fields given in UTC.CalendarAwareDateutc(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute, int p_iSecond, int p_iMillisecond)Create a date object from date fields given in UTC.CalendarAwareDateutcNow()Create a date object with the current date and time.CalendarAwareDatewrap(Object p_date)Wrap the instance in time into aCalendarAwareDate.CalendarAwareDatewrap(Object p_date, TimeZone p_tz)Wrap the instance in time into aCalendarAwareDate.
-
-
-
Field Detail
-
UTC_ISO_DATE_TIME_FORMAT
public static final String UTC_ISO_DATE_TIME_FORMAT
The standard ISO UTC formatyyyy-MM-dd'T'HH:mm:ss'Z'.- See Also:
- Constant Field Values
-
UTC_ISO_DATE_TIME_FORMAT_MILLIS
public static final String UTC_ISO_DATE_TIME_FORMAT_MILLIS
The standard ISO UTC format with millisecondsyyyy-MM-dd'T'HH:mm:ss.SSS'Z'.- See Also:
- Constant Field Values
-
DATE_TIME_FORMAT_1
public static final String DATE_TIME_FORMAT_1
The formatyyyy-MM-dd HH:mm:ss.- See Also:
- Constant Field Values
-
DATE_TIME_FORMAT_2
public static final String DATE_TIME_FORMAT_2
The formatyyyy-MM-dd HH:mm.- See Also:
- Constant Field Values
-
COMPARATOR_DATE_TIME_SORT_NULL_LOW
public static final Comparator<Object> COMPARATOR_DATE_TIME_SORT_NULL_LOW
Compares two date/time objects with millisecond accuracy.nullis sorted low.The comparator accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers,
- calendar objects, and
null
-
COMPARATOR_DATE_TIME_SORT_NULL_HIGH
public static final Comparator<Object> COMPARATOR_DATE_TIME_SORT_NULL_HIGH
Compares two date/time objects with millisecond accuracy.nullis sorted high.The comparator accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers,
- calendar objects, and
null
-
-
Method Detail
-
getServerDefaultTimeZone
public TimeZone getServerDefaultTimeZone()
Get the default server time zone.- Returns:
- The default time zone.
-
getTimeZone
public TimeZone getTimeZone(IUser p_user)
Get the context time zone from the user, or, if not present, the default server time zone.- Parameters:
p_user- The user from which to get the time zone, ornull.
-
getTimeZone
public TimeZone getTimeZone(String p_strTimeZoneId)
Get the specified time zone.- Parameters:
p_strTimeZoneId- The time zone ID, either a full name such as "Europe/Berlin", "America/Los_Angeles", or a custom ID such as "GMT-8:00".- Returns:
- The default time zone.
-
wrap
public CalendarAwareDate wrap(Object p_date)
Wrap the instance in time into aCalendarAwareDate.The new object will have an UTC calendar associated for date arithmetics.
- Parameters:
p_date- An object that represents a date.- Returns:
- A new date object that represents the same instance in time.
- See Also:
wrap(Object, TimeZone)
-
wrap
public CalendarAwareDate wrap(Object p_date, TimeZone p_tz)
Wrap the instance in time into aCalendarAwareDate.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
p_dateargument.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_date- An object that represents a date.p_tz- The time zone to be associated with the resultant date object.- Returns:
- A new date object that represents the same instance in time.
- Throws:
IllegalArgumentException- Ifp_dateisnull, or a value holder that does not contain a value, or ifp_tzisnull.
-
compareNullLow
public int compareNullLow(Object p_lhs, Object p_rhs)
Compares two date/time objects with millisecond accuracy.nullis sorted low.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers,
- calendar objects, and
null
- Parameters:
p_lhs- The left hand side of the comparison.p_rhs- The right hand side of the comparison.- Returns:
- Either
0, or1, or-1.
-
compareNullHigh
public int compareNullHigh(Object p_lhs, Object p_rhs)
Compares two date/time objects with millisecond accuracy.nullis sorted high.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers,
- calendar objects, and
null
- Parameters:
p_lhs- The left hand side of the comparison.p_rhs- The right hand side of the comparison.- Returns:
- Either
0, or1, or-1.
-
sortNullLow
public List<Object> sortNullLow(List<Object> p_list)
Sort the given list of date/time objects with millisecond accuracy.nulls are sorted low.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers,
- calendar objects, and
null
- Parameters:
p_list- The list to be sorted.- Returns:
- The given list.
-
sortNullHigh
public List<Object> sortNullHigh(List<Object> p_list)
Sort the given list of date/time objects with millisecond accuracy.nulls are sorted high.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers,
- calendar objects, and
null
- Parameters:
p_list- The list to be sorted.- Returns:
- The given list.
-
utcNow
public CalendarAwareDate utcNow()
Create a date object with the current date and time.The new object will have an UTC calendar associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.4.4.
- Returns:
- The newly created date object.
-
now
public CalendarAwareDate now(TimeZone p_tz)
Create a date object with the current date and time.The new object will have a calendar with the specified time zone associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.4.4.
- Parameters:
p_tz- The time zone.- Returns:
- The newly created date object.
-
date
public CalendarAwareDate date(int p_iYear, TimeZone p_tz)
Create a date object from date fields given in the specified time zone.The month is set to January, the day is set to
1, the remaining fields are set to0.The new object will have a calendar with the specified time zone associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.2.1.
- Parameters:
p_iYear- The year.p_tz- The time zone to be used.- Returns:
- The newly created date object.
- Throws:
IllegalArgumentException- Ifp_tzisnull.
-
date
public CalendarAwareDate date(int p_iYear, int p_iMonth, TimeZone p_tz)
Create a date object from date fields given in the specified time zone.The day is set to
1, the remaining fields are set to0.The new object will have a calendar with the specified time zone associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.2.1.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_tz- The time zone to be used.- Returns:
- The newly created date object.
- Throws:
IllegalArgumentException- Ifp_tzisnull.
-
date
public CalendarAwareDate date(int p_iYear, int p_iMonth, int p_iDay, TimeZone p_tz)
Create a date object from date fields given in the specified time zone.The time fields are set to
0.The new object will have a calendar with the specified time zone associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.2.1.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.p_tz- The time zone to be used.- Returns:
- The newly created date object.
- Throws:
IllegalArgumentException- Ifp_tzisnull.
-
date
public CalendarAwareDate date(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, TimeZone p_tz)
Create a date object from date fields given in the specified time zone.The new object will have a calendar with the specified time zone associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.2.1.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.p_iHour- The hour of day.p_tz- The time zone to be used.- Returns:
- The newly created date object.
- Throws:
IllegalArgumentException- Ifp_tzisnull.
-
date
public CalendarAwareDate date(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute, TimeZone p_tz)
Create a date object from date fields given in the specified time zone.The new object will have a calendar with the specified time zone associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.2.1.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.p_iHour- The hour of day.p_iMinute- The minute.p_tz- The time zone to be used.- Returns:
- The newly created date object.
- Throws:
IllegalArgumentException- Ifp_tzisnull.
-
date
public CalendarAwareDate date(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute, int p_iSecond, TimeZone p_tz)
Create a date object from date fields given in the specified time zone.The new object will have a calendar with the specified time zone associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.2.1.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.p_iHour- The hour of day.p_iMinute- The minute.p_iSecond- The second.p_tz- The time zone to be used.- Returns:
- The newly created date object.
- Throws:
IllegalArgumentException- Ifp_tzisnull.
-
date
public CalendarAwareDate date(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute, int p_iSecond, int p_iMillisecond, TimeZone p_tz)
Create a date object from date fields given in the specified time zone.The new object will have a calendar with the specified time zone associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.2.1.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.p_iHour- The hour of day.p_iMinute- The minute.p_iSecond- The second.p_iMillisecond- The milliseconds.p_tz- The time zone to be used.- Returns:
- The newly created date object.
- Throws:
IllegalArgumentException- Ifp_tzisnull.
-
utc
public CalendarAwareDate utc(int p_iYear)
Create a date object from date fields given in UTC.The month is set to January, the day is set to
1, the remaining fields are set to0.The new object will have an UTC calendar associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.4.3.
- Parameters:
p_iYear- The year.- Returns:
- The newly created date object.
-
utc
public CalendarAwareDate utc(int p_iYear, int p_iMonth)
Create a date object from date fields given in UTC.The day is set to
1, the remaining fields are set to0.The new object will have an UTC calendar associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.4.3.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).- Returns:
- The newly created date object.
-
utc
public CalendarAwareDate utc(int p_iYear, int p_iMonth, int p_iDay)
Create a date object from date fields given in UTC.The time fields are set to
0.The new object will have an UTC calendar associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.4.3.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.- Returns:
- The newly created date object.
-
utc
public CalendarAwareDate utc(int p_iYear, int p_iMonth, int p_iDay, int p_iHour)
Create a date object from date fields given in UTC.The new object will have an UTC calendar associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.4.3.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.p_iHour- The hour of day.- Returns:
- The newly created date object.
-
utc
public CalendarAwareDate utc(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute)
Create a date object from date fields given in UTC.The new object will have an UTC calendar associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.4.3.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.p_iHour- The hour of day.p_iMinute- The minute.- Returns:
- The newly created date object.
-
utc
public CalendarAwareDate utc(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute, int p_iSecond)
Create a date object from date fields given in UTC.The new object will have an UTC calendar associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.4.3.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.p_iHour- The hour of day.p_iMinute- The minute.p_iSecond- The second.- Returns:
- The newly created date object.
-
utc
public CalendarAwareDate utc(int p_iYear, int p_iMonth, int p_iDay, int p_iHour, int p_iMinute, int p_iSecond, int p_iMillisecond)
Create a date object from date fields given in UTC.The new object will have an UTC calendar associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.4.3.
- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.p_iHour- The hour of day.p_iMinute- The minute.p_iSecond- The second.p_iMillisecond- The milliseconds.- Returns:
- The newly created date object.
-
isToday
public boolean isToday(Object p_obj, TimeZone p_tz)
Check if the given object references the same year, month, and day as the current date. Hours, minutes, seconds, and milliseconds are ignored.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_obj- An object that references a date.p_tz- The time zone where the comparison should take place.- Returns:
trueif the given object refers to the the same year, month, and day as the current date, orfalseotherwise.- Throws:
IllegalArgumentException- If the given value isnull, or a value holder that does not contain a value.
-
isSameY
public boolean isSameY(Object p_obj1, Object p_obj2, TimeZone p_tz)
Check if the given objects reference the same year. Months, days, hours, minutes, seconds, and milliseconds are ignored.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_obj1- The first object in the comparison.p_obj2- The second object in the comparison.p_tz- The time zone where the comparison should take place.- Returns:
trueif the two objects refer to the the same year, orfalseotherwise.- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
isSameYM
public boolean isSameYM(Object p_obj1, Object p_obj2, TimeZone p_tz)
Check if the given objects reference the same year, and month. Days, hours, minutes, seconds, and milliseconds are ignored.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_obj1- The first object in the comparison.p_obj2- The second object in the comparison.p_tz- The time zone where the comparison should take place.- Returns:
trueif the two objects refer to the the same year, and month, orfalseotherwise.- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
isSameYMD
public boolean isSameYMD(Object p_obj1, Object p_obj2, TimeZone p_tz)
Check if the given objects reference the same year, month, and day. Hours, minutes, seconds, and milliseconds are ignored.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_obj1- The first object in the comparison.p_obj2- The second object in the comparison.p_tz- The time zone where the comparison should take place.- Returns:
trueif the two objects refer to the the same year, month, and day, orfalseotherwise.- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
isSameH
public boolean isSameH(Object p_obj1, Object p_obj2, TimeZone p_tz)
Check if the given objects reference the same hour. Year, month, day, minutes, seconds, and milliseconds are ignored.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_obj1- The first object in the comparison.p_obj2- The second object in the comparison.p_tz- The time zone where the comparison should take place.- Returns:
trueif the two objects refer to the the same hour, orfalseotherwise.- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
isSameHM
public boolean isSameHM(Object p_obj1, Object p_obj2, TimeZone p_tz)
Check if the given objects reference the same hour, and minute. Year, month, day, seconds, and milliseconds are ignored.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_obj1- The first object in the comparison.p_obj2- The second object in the comparison.p_tz- The time zone where the comparison should take place.- Returns:
trueif the two objects refer to the the same hour, and minute, orfalseotherwise.- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
isSameHMS
public boolean isSameHMS(Object p_obj1, Object p_obj2, TimeZone p_tz)
Check if the given objects reference the same hour, minute, and second. Year, month, day, and milliseconds are ignored.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_obj1- The first object in the comparison.p_obj2- The second object in the comparison.p_tz- The time zone where the comparison should take place.- Returns:
trueif the two objects refer to the the same hour, minute, and second, orfalseotherwise.- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
isSameHMSM
public boolean isSameHMSM(Object p_obj1, Object p_obj2, TimeZone p_tz)
Check if the given objects reference the same hour, minute, second, and millisecond. Year, month, and day are ignored.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_obj1- The first object in the comparison.p_obj2- The second object in the comparison.p_tz- The time zone where the comparison should take place.- Returns:
trueif the two objects refer to the the same hour, minute, and second, orfalseotherwise.- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
getDifference
public Duration getDifference(Object p_lhs, Object p_rhs)
Get the time difference between the two objects.Note that this method does not have any information about a calendar to be used. So differences that span DST switches in a certain calendar might not return the expected result when expressed in days.
The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_lhs- The left hand side of the difference.p_rhs- The right hand side of the difference.- Returns:
- The difference.
- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
getDifferenceFromMilliseconds
public Duration getDifferenceFromMilliseconds(long p_lTime)
Ctreate a difference object for the given time difference.- Parameters:
p_lTime- The time difference in milliseconds.- Returns:
- The difference.
-
getDifferenceInMilliseconds
public long getDifferenceInMilliseconds(Object p_lhs, Object p_rhs)
Get the time difference in milliseconds between the two objects.The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_lhs- The left hand side of the difference.p_rhs- The right hand side of the difference.- Returns:
- The difference in milliseconds.
- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
getDifferenceInYears
public int getDifferenceInYears(Object p_lhs, Object p_rhs, TimeZone p_tz)
Get the time difference in full years between the two objects.difference = left hand side - right hand side
The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_lhs- The left hand side of the difference.p_rhs- The right hand side of the difference.p_tz- The time zone to be used to calculate the difference.- Returns:
- The difference in years.
- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
getDifferenceInMonths
public int getDifferenceInMonths(Object p_lhs, Object p_rhs, TimeZone p_tz)
Get the time difference in full months between the two objects.difference = left hand side - right hand side
The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_lhs- The left hand side of the difference.p_rhs- The right hand side of the difference.p_tz- The time zone to be used to calculate the difference.- Returns:
- The difference in months.
- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
getDifferenceInDays
public int getDifferenceInDays(Object p_lhs, Object p_rhs, TimeZone p_tz)
Get the time difference in full days between the two objects.difference = left hand side - right hand side
The method accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_lhs- The left hand side of the difference.p_rhs- The right hand side of the difference.p_tz- The time zone to be used to calculate the difference.- Returns:
- The difference in days.
- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value.
-
isLeapYear
public boolean isLeapYear(int p_iYear)
Determines if the given year is a leap year in the Gregorian Calendar.- Parameters:
p_iYear- The year.- Returns:
trueif the given year is a leap year, orfalseotherwise.
-
getLunationNumber
public long getLunationNumber(Object p_date)
Get the Brown Lunation Number.See Wikipedia: Lunation Number
The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents the date for which the lunation number should be calculated.- Returns:
- The Brown Lunation Number.
-
getMeeusLunationNumber
public long getMeeusLunationNumber(Object p_date)
Get the Meeus Lunation Number.See Wikipedia: Lunation Number
The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents the date for which the lunation number should be calculated.- Returns:
- The Brown Lunation Number.
-
getPhaseOfTheMoon
public double getPhaseOfTheMoon(Object p_date)
Get the phase of the moon.The result is a value greater or equal zero, and less than one, representing the phase of the moon from new moon to new moon.
The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents the date for which the phase of the moon should be calculated.- Returns:
- A value greater or equal zero, and less than one.
-
getISO8601WeekNumber
public int getISO8601WeekNumber(int p_iYear, int p_iMonth, int p_iDay)Get the week number as defined in DIN 1355/ISO 8601.- Parameters:
p_iYear- The year.p_iMonth- The month (0for January, ...).p_iDay- The day of month.- Returns:
- The week number as defined in DIN 1355/ISO 8601.
-
getISO8601WeekNumber
public int getISO8601WeekNumber(Object p_date, TimeZone p_tz)
Get the week number as defined in DIN 1355/ISO 8601.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
p_dateargument.- Returns:
- The week number as defined in DIN 1355/ISO 8601.
- Throws:
IllegalArgumentException- If a given value isnull, or a value holder that does not contain a value, or ifp_tzisnull.
-
getISO8601WeekStart
public CalendarAwareDate getISO8601WeekStart(int p_iYear, int p_iWeek, TimeZone p_tz)
Get the beginning of the week as defined in ISO 8601.- Parameters:
p_iYear- The year.p_iWeek- The week (1 is the first week of the year, 2 the second ..., 0 ist the last week of the year before, ...).p_tz- The time zone.- Returns:
- The beginning of the week.
-
getQuarter
public int getQuarter(Object p_date, TimeZone p_tz)
Get the quarter that contains the given date.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.p_tz- The time zone.- Returns:
- The quarter, i.e. either
1,2,3, or4. - Since:
- Intrexx 7.0.
-
getStartOfQuarter
public CalendarAwareDate getStartOfQuarter(Object p_date, TimeZone p_tz)
Get the start of the quarter that contains the given date. Hour, minute, seconds, and fractions of seconds are set to zero.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.p_tz- The time zone.- Returns:
- The start of the quarter as both a
java.sql.Timestampand as a.IDateTimeValueHolder - Since:
- Intrexx 7.0.
-
getStartOfWeek
public CalendarAwareDate getStartOfWeek(Object p_obj, int p_iFirstDayOfWeek, TimeZone p_tz)
Get the start of the week that contains the given date. Hour, minute, seconds, and fractions of seconds are set to zero.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The date, either as an integer, or date, orIValueHolder.p_iFirstDayOfWeek- The day the weeks starts with (1 for Sunday, 2 for Monday, ..., 7 for Saturday).p_tz- The time zone.- Returns:
- The date that represents the requested start of the week as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getShroveMondayDate
public CalendarAwareDate getShroveMondayDate(Object p_obj, TimeZone p_tz)
Get the Shrove Monday (Rosenmontag) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Shrove Monday date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getAshWednesdayDate
public CalendarAwareDate getAshWednesdayDate(Object p_obj, TimeZone p_tz)
Get the Ash Wednesday (Aschermittwoch) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Ash Wednesday date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getMaundyThursdayDate
public CalendarAwareDate getMaundyThursdayDate(Object p_obj, TimeZone p_tz)
Get the Maundy Thursday (Gründonnerstag) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Maundy Thursday date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getGoodFridayDate
public CalendarAwareDate getGoodFridayDate(Object p_obj, TimeZone p_tz)
Get the Good Friday (Karfreitag) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Good Friday date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getEasterDate
public CalendarAwareDate getEasterDate(Object p_obj, TimeZone p_tz)
Get the Easter (Ostersonntag) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Easter date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getEasterMondayDate
public CalendarAwareDate getEasterMondayDate(Object p_obj, TimeZone p_tz)
Get the Easter Monday (Ostermontag) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Easter Monday date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getAscensionDate
public CalendarAwareDate getAscensionDate(Object p_obj, TimeZone p_tz)
Get the Ascension Day (Christi Himmelfahrt) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Ascension Day date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getWhitSundayDate
public CalendarAwareDate getWhitSundayDate(Object p_obj, TimeZone p_tz)
Get the Whit Sunday (Pfingstsonntag) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Whit Sunday date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getWhitMondayDate
public CalendarAwareDate getWhitMondayDate(Object p_obj, TimeZone p_tz)
Get the Whit Monday (Pfingstmontag) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Whit Monday date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getPentecostDate
public CalendarAwareDate getPentecostDate(Object p_obj, TimeZone p_tz)
Get the Pentecost date (Pfingstsonntag) in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Pentecost date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getCorpusChristiDate
public CalendarAwareDate getCorpusChristiDate(Object p_obj, TimeZone p_tz)
Get the Corpus Christi (Fronleichnam) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Corpus Christi date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
getPenanceDayDate
public CalendarAwareDate getPenanceDayDate(Object p_obj, TimeZone p_tz)
Get the Penance Day (Buß- und Bettag) date in the given year.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_obj- The year, either as an integer, or date, orIValueHolder.p_tz- The time zone.- Returns:
- The Penance Day date as both a
java.sql.Timestampand as a.IDateTimeValueHolder
-
dateToISOString
public String dateToISOString(Object p_date)
Get a string value that represents the instance in time represented by the given date object, without milliseconds.The format of the string is
yyyy-MM-dd'T'HH:mm:ss'Z'. The time zone is always UTC, as denoted by the suffix Z. See also the ECMAScript Language Specification, ECMA-262, 15.9.1.15 and 15.9.5.43.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.- Returns:
- The string value.
- Throws:
IllegalArgumentException- Ifp_dateisnull.
-
dateToISOStringWithMilliseconds
public String dateToISOStringWithMilliseconds(Object p_date)
Get a string value that represents the instance in time represented by the given date object, including millisecondsThe format of the string is
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. The time zone is always UTC, as denoted by the suffix Z. See also the ECMAScript Language Specification, ECMA-262, 15.9.1.15 and 15.9.5.43.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.- Returns:
- The string value.
- Throws:
IllegalArgumentException- Ifp_dateisnull.
-
getDayOfWeekName
public String getDayOfWeekName(Number p_num)
Get the day of week name by its number (1 = Sunday, ..., 7 = Saturday).- Parameters:
p_num- The day of week number.- Returns:
- The name of the given day of week.
- Since:
- Intrexx 7.0.
-
getDayOfWeekName
public String getDayOfWeekName(Number p_num, String p_strLocaleId)
Get the day of week name by its number (1 = Sunday, ..., 7 = Saturday).- Parameters:
p_num- The day of week number.p_strLocaleId- The locale to be used.- Returns:
- The name of the given day of week.
- Since:
- Intrexx 7.0.
-
getDayOfWeekShortName
public String getDayOfWeekShortName(Number p_num)
Get the day of week short name by its number (1 = Sun, ..., 7 = Sat).- Parameters:
p_num- The day of week number.- Returns:
- The short name of the given day of week.
- Since:
- Intrexx 7.0.
-
getDayOfWeekShortName
public String getDayOfWeekShortName(Number p_num, String p_strLocaleId)
Get the day of week short name by its number (1 = Sun, ..., 7 = Sat).- Parameters:
p_num- The day of week number.p_strLocaleId- The locale to be used.- Returns:
- The short name of the given day of week.
- Since:
- Intrexx 7.0.
-
getDayOfWeekName
public String getDayOfWeekName(Object p_date, TimeZone p_tz)
Get the name of the given day of week.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.p_tz- The time zone to be used.- Returns:
- The name of the given day of week.
- Throws:
IllegalArgumentException- Ifp_dateorp_tzisnull.- Since:
- Intrexx 7.0.
-
getDayOfWeekName
public String getDayOfWeekName(Object p_date, TimeZone p_tz, String p_strLocaleId)
Get the name of the given day of week.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.p_tz- The time zone to be used.p_strLocaleId- The ID (language tag) of the locale to be used.- Returns:
- The name of the given day of week.
- Throws:
IllegalArgumentException- Ifp_dateorp_tzisnull.- Since:
- Intrexx 7.0.
-
getDayOfWeekShortName
public String getDayOfWeekShortName(Object p_date, TimeZone p_tz)
Get the short name of the given day of week.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.p_tz- The time zone to be used.- Returns:
- The short name of the given day of week.
- Throws:
IllegalArgumentException- Ifp_dateorp_tzisnull.- Since:
- Intrexx 7.0.
-
getDayOfWeekShortName
public String getDayOfWeekShortName(Object p_date, TimeZone p_tz, String p_strLocaleId)
Get the short name of the given day of week.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.p_tz- The time zone to be used.p_strLocaleId- The ID (language tag) of the locale to be used.- Returns:
- The short name of the given day of week.
- Throws:
IllegalArgumentException- Ifp_dateorp_tzisnull.- Since:
- Intrexx 7.0.
-
getMonthName
public String getMonthName(Number p_num)
Get the month name by its number (0 = January, ..., 11 = December).- Parameters:
p_num- The month number which can be any integer value.- Returns:
- The month name.
- Since:
- Intrexx 7.0.
-
getMonthName
public String getMonthName(Number p_num, String p_strLocaleId)
Get the month name by its number (0 = January, ..., 11 = December).- Parameters:
p_num- The month number which can be any integer value.p_strLocaleId- The locale to be used.- Returns:
- The month name.
- Since:
- Intrexx 7.0.
-
getMonthShortName
public String getMonthShortName(Number p_num)
Get the month short name by its number (0 = Jan, ..., 11 = Dec).- Parameters:
p_num- The month number which can be any integer value.- Returns:
- The month short name.
- Since:
- Intrexx 7.0.
-
getMonthShortName
public String getMonthShortName(Number p_num, String p_strLocaleId)
Get the month short name by its number (0 = Jan, ..., 11 = Dec).- Parameters:
p_num- The month number which can be any integer value.p_strLocaleId- The locale to be used.- Returns:
- The month short name.
- Since:
- Intrexx 7.0.
-
getMonthName
public String getMonthName(Object p_date, TimeZone p_tz)
Get the name of the given month.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.p_tz- The time zone to be used.- Returns:
- The name of the given month.
- Throws:
IllegalArgumentException- Ifp_dateorp_tzisnull.- Since:
- Intrexx 7.0.
-
getMonthName
public String getMonthName(Object p_date, TimeZone p_tz, String p_strLocaleId)
Get the name of the given month.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.p_tz- The time zone to be used.p_strLocaleId- The ID (language tag) of the locale to be used.- Returns:
- The name of the given month.
- Throws:
IllegalArgumentException- Ifp_dateorp_tzisnull.- Since:
- Intrexx 7.0.
-
getMonthShortName
public String getMonthShortName(Object p_date, TimeZone p_tz)
Get the short name of the given month.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.p_tz- The time zone to be used.- Returns:
- The short name of the given month.
- Throws:
IllegalArgumentException- Ifp_dateorp_tzisnull.- Since:
- Intrexx 7.0.
-
getMonthShortName
public String getMonthShortName(Object p_date, TimeZone p_tz, String p_strLocaleId)
Get the short name of the given month.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_date- An object that represents a date.p_tz- The time zone to be used.p_strLocaleId- The ID (language tag) of the locale to be used.- Returns:
- The short name of the given month.
- Throws:
IllegalArgumentException- Ifp_dateorp_tzisnull.- Since:
- Intrexx 7.0.
-
formatDate
public String formatDate(String p_strFormat, Object p_date, TimeZone p_tz)
Format a date according to the given simple date format.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_strFormat- The format string (seeSimpleDateFormat).p_date- An object that represents a date.p_tz- The time zone to be used.- Returns:
- The formatted date.
- Throws:
IllegalArgumentException- Ifp_strFormat, orp_dateorp_tzisnull.
-
formatDate
public String formatDate(String p_strFormat, Object p_date, TimeZone p_tz, String p_strLocaleId)
Format a date according to the given simple date format.The method accepts
- date objects,
- timestamp objects,
- value holders,
- numbers, and
- calendar objects
- Parameters:
p_strFormat- The format string (seeSimpleDateFormat).p_date- An object that represents a date.p_tz- The time zone to be used.p_strLocaleId- The ID (language tag) of the locale to be used.- Returns:
- The formatted date.
- Throws:
IllegalArgumentException- Ifp_strFormat, orp_dateorp_tzisnull.
-
isoStringToDate
public CalendarAwareDate isoStringToDate(String p_strDate)
Parse a string of the formyyyy-MM-dd'T'HH:mm:ss'Z'oryyyy-MM-dd'T'HH:mm:ss.SSS'Z'as a date.The new object will have an UTC calendar associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.1.15.
- Parameters:
p_strDate- The string that represents the date.- Returns:
- The parsed date, or
nullif an error occurred while parsing.
-
isoStringToDate
public CalendarAwareDate isoStringToDate(String p_strDate, TimeZone p_tz)
Parse a string of the formyyyy-MM-dd'T'HH:mm:ss'Z'oryyyy-MM-dd'T'HH:mm:ss.SSS'Z'as a date.The new date object will have a calendar with the specified time zone associated for date arithmetics.
See also the ECMAScript Language Specification, ECMA-262, 15.9.1.15.
- Parameters:
p_strDate- The string that represents the date.p_tz- The time zone to be associated with the resultant date object.- Returns:
- The parsed date, or
nullif an error occurred while parsing. - Throws:
IllegalArgumentException- Ifp_strDateisnullor empty.
-
parseDate
public CalendarAwareDate parseDate(String p_strFormat, String p_strDate, TimeZone p_tzParse)
Parse a string with the given format as a date in the given time zone.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_strFormat- The format string (seeSimpleDateFormat).p_strDate- The string to be parsed.p_tzParse- The time zone used to parse the string.- Returns:
- The parsed date, or
nullif an error occurred while parsing. - Throws:
IllegalArgumentException- Ifp_strFormatorp_strDateisnullor empty, or if the given time zone isnull.- Since:
- Intrexx 6.0. The method with the same name and signature in previous versions had different semantics.
-
parseDate
public CalendarAwareDate parseDate(String p_strFormat, String p_strDate, TimeZone p_tzParse, String p_strLocaleId)
Parse a string with the given format as a date in the given time zone.The new object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_strFormat- The format string (seeSimpleDateFormat).p_strDate- The string to be parsed.p_tzParse- The time zone used to parse the string.p_strLocaleId- The ID (language tag) of the locale to be used.- Returns:
- The parsed date, or
nullif an error occurred while parsing. - Throws:
IllegalArgumentException- Ifp_strFormatorp_strDateisnullor empty, or if the given time zone isnull.- Since:
- Intrexx 7.0.
-
parseDate
public CalendarAwareDate parseDate(String p_strFormat, String p_strDate, TimeZone p_tzParse, TimeZone p_tzAssoc)
Parse a string with the given format as a date in the given time zone.The new date object will have a calendar with the time zone given as the fourth parameter associated for date arithmetics.
- Parameters:
p_strFormat- The format string (seeSimpleDateFormat).p_strDate- The string to be parsed.p_tzParse- The time zone used to parse the string.p_tzAssoc- The time zone to be associated with the resultant date object.- Returns:
- The parsed date, or
nullif an error occurred while parsing. - Throws:
IllegalArgumentException- Ifp_strFormatorp_strDateisnullor empty, or if one the given time zones isnull.- Since:
- Intrexx 6.0.
-
parseDate
public CalendarAwareDate parseDate(String p_strFormat, String p_strDate, TimeZone p_tzParse, TimeZone p_tzAssoc, String p_strLocaleId)
Parse a string with the given format as a date in the given time zone.The new date object will have a calendar with the time zone given as the fourth parameter associated for date arithmetics.
- Parameters:
p_strFormat- The format string (seeSimpleDateFormat).p_strDate- The string to be parsed.p_tzParse- The time zone used to parse the string.p_tzAssoc- The time zone to be associated with the resultant date object.p_strLocaleId- The ID (language tag) of the locale to be used.- Returns:
- The parsed date, or
nullif an error occurred while parsing. - Throws:
IllegalArgumentException- Ifp_strFormatorp_strDateisnullor empty, or if one the given time zones isnull.- Since:
- Intrexx 7.0.
-
parseUTCDate
public CalendarAwareDate parseUTCDate(String p_strFormat, String p_strDate)
Parse a string with the given format as a date in the UTC time zone.The new date object will have a calendar with the UTC time zone associated for date arithmetics.
- Parameters:
p_strFormat- The format string (seeSimpleDateFormat).p_strDate- The string to be parsed.- Returns:
- The parsed date, or
nullif an error occurred while parsing. - Throws:
IllegalArgumentException- Ifp_strFormatorp_strDateisnullor empty.- Since:
- Intrexx 6.0.
-
parseUTCDate
public CalendarAwareDate parseUTCDate(String p_strFormat, String p_strDate, String p_strLocaleId)
Parse a string with the given format as a date in the UTC time zone.The new date object will have a calendar with the UTC time zone associated for date arithmetics.
- Parameters:
p_strFormat- The format string (seeSimpleDateFormat).p_strDate- The string to be parsed.p_strLocaleId- The ID (language tag) of the locale to be used.- Returns:
- The parsed date, or
nullif an error occurred while parsing. - Throws:
IllegalArgumentException- Ifp_strFormatorp_strDateisnullor empty.- Since:
- Intrexx 7.0.
-
parseUTCDate
public CalendarAwareDate parseUTCDate(String p_strFormat, String p_strDate, TimeZone p_tzAssoc)
Parse a string with the given format as a date in the UTC time zone.The new date object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_strFormat- The format string (seeSimpleDateFormat).p_strDate- The string to be parsed.p_tzAssoc- The time zone to be associated with the resultant date object.- Returns:
- The parsed date, or
nullif an error occurred while parsing. - Throws:
IllegalArgumentException- Ifp_strFormatorp_strDateisnullor empty, or if the given time zone isnull.- Since:
- Intrexx 6.0.
-
parseUTCDate
public CalendarAwareDate parseUTCDate(String p_strFormat, String p_strDate, TimeZone p_tzAssoc, String p_strLocaleId)
Parse a string with the given format as a date in the UTC time zone.The new date object will have a calendar with the specified time zone associated for date arithmetics.
- Parameters:
p_strFormat- The format string (seeSimpleDateFormat).p_strDate- The string to be parsed.p_tzAssoc- The time zone to be associated with the resultant date object.p_strLocaleId- The ID (language tag) of the locale to be used.- Returns:
- The parsed date, or
nullif an error occurred while parsing. - Throws:
IllegalArgumentException- Ifp_strFormatorp_strDateisnullor empty, or if the given time zone isnull.- Since:
- Intrexx 7.0.
-
-