Class DateTimeUtil
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Comparator<Object>
Compares two date/time objects with millisecond accuracy.static final Comparator<Object>
Compares two date/time objects with millisecond accuracy.static final String
The formatyyyy-MM-dd HH:mm:ss
.static final String
The formatyyyy-MM-dd HH:mm
.static final String
The standard ISO UTC formatyyyy-MM-dd'T'HH:mm:ss'Z'
.static final String
The standard ISO UTC format with millisecondsyyyy-MM-dd'T'HH:mm:ss.SSS'Z'
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareNullHigh
(Object p_lhs, Object p_rhs) Compares two date/time objects with millisecond accuracy.int
compareNullLow
(Object p_lhs, Object p_rhs) Compares two date/time objects with millisecond accuracy.de.uplanet.lucy.server.scripting.velocity.util.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.de.uplanet.lucy.server.scripting.velocity.util.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.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Create a date object from date fields given in the specified time zone.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Create a date object from date fields given in the specified time zone.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Create a date object from date fields given in the specified time zone.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Create a date object from date fields given in the specified time zone.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Create a date object from date fields given in the specified time zone.dateToISOString
(Object p_date) Get a string value that represents the instance in time represented by the given date object, without milliseconds.Get a string value that represents the instance in time represented by the given date object, including millisecondsformatDate
(String p_strFormat, Object p_date, TimeZone p_tz) Format a date according to the given simple date format.formatDate
(String p_strFormat, Object p_date, TimeZone p_tz, String p_strLocaleId) Format a date according to the given simple date format.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getAscensionDate
(Object p_obj, TimeZone p_tz) Get the Ascension Day (Christi Himmelfahrt) date in the given year.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getAshWednesdayDate
(Object p_obj, TimeZone p_tz) Get the Ash Wednesday (Aschermittwoch) date in the given year.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getCorpusChristiDate
(Object p_obj, TimeZone p_tz) Get the Corpus Christi (Fronleichnam) date in the given year.getDayOfWeekName
(Number p_num) Get the day of week name by its number (1 = Sunday, ..., 7 = Saturday).getDayOfWeekName
(Number p_num, String p_strLocaleId) Get the day of week name by its number (1 = Sunday, ..., 7 = Saturday).getDayOfWeekName
(Object p_date, TimeZone p_tz) Get the name of the given day of week.getDayOfWeekName
(Object p_date, TimeZone p_tz, String p_strLocaleId) Get the name of the given day of week.getDayOfWeekShortName
(Number p_num) Get the day of week short name by its number (1 = Sun, ..., 7 = Sat).getDayOfWeekShortName
(Number p_num, String p_strLocaleId) Get the day of week short name by its number (1 = Sun, ..., 7 = Sat).getDayOfWeekShortName
(Object p_date, TimeZone p_tz) Get the short name of the given day of week.getDayOfWeekShortName
(Object p_date, TimeZone p_tz, String p_strLocaleId) Get the short name of the given day of week.de.uplanet.lucy.server.scripting.velocity.util.Duration
getDifference
(Object p_lhs, Object p_rhs) Get the time difference between the two objects.de.uplanet.lucy.server.scripting.velocity.util.Duration
getDifferenceFromMilliseconds
(long p_lTime) Ctreate a difference object for the given time difference.int
getDifferenceInDays
(Object p_lhs, Object p_rhs, TimeZone p_tz) Get the time difference in full days between the two objects.long
getDifferenceInMilliseconds
(Object p_lhs, Object p_rhs) Get the time difference in milliseconds between the two objects.int
getDifferenceInMonths
(Object p_lhs, Object p_rhs, TimeZone p_tz) Get the time difference in full months between the two objects.int
getDifferenceInYears
(Object p_lhs, Object p_rhs, TimeZone p_tz) Get the time difference in full years between the two objects.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getEasterDate
(Object p_obj, TimeZone p_tz) Get the Easter (Ostersonntag) date in the given year.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getEasterMondayDate
(Object p_obj, TimeZone p_tz) Get the Easter Monday (Ostermontag) date in the given year.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getGoodFridayDate
(Object p_obj, TimeZone p_tz) Get the Good Friday (Karfreitag) date in the given year.int
getISO8601WeekNumber
(int p_iYear, int p_iMonth, int p_iDay) Get the week number as defined in DIN 1355/ISO 8601.int
getISO8601WeekNumber
(Object p_date, TimeZone p_tz) Get the week number as defined in DIN 1355/ISO 8601.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getISO8601WeekStart
(int p_iYear, int p_iWeek, TimeZone p_tz) Get the beginning of the week as defined in ISO 8601.long
getLunationNumber
(Object p_date) Get the Brown Lunation Number.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getMaundyThursdayDate
(Object p_obj, TimeZone p_tz) Get the Maundy Thursday (Gründonnerstag) date in the given year.long
getMeeusLunationNumber
(Object p_date) Get the Meeus Lunation Number.getMonthName
(Number p_num) Get the month name by its number (0 = January, ..., 11 = December).getMonthName
(Number p_num, String p_strLocaleId) Get the month name by its number (0 = January, ..., 11 = December).getMonthName
(Object p_date, TimeZone p_tz) Get the name of the given month.getMonthName
(Object p_date, TimeZone p_tz, String p_strLocaleId) Get the name of the given month.getMonthShortName
(Number p_num) Get the month short name by its number (0 = Jan, ..., 11 = Dec).getMonthShortName
(Number p_num, String p_strLocaleId) Get the month short name by its number (0 = Jan, ..., 11 = Dec).getMonthShortName
(Object p_date, TimeZone p_tz) Get the short name of the given month.getMonthShortName
(Object p_date, TimeZone p_tz, String p_strLocaleId) Get the short name of the given month.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getPenanceDayDate
(Object p_obj, TimeZone p_tz) Get the Penance Day (Buß- und Bettag) date in the given year.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getPentecostDate
(Object p_obj, TimeZone p_tz) Get the Pentecost date (Pfingstsonntag) in the given year.double
getPhaseOfTheMoon
(Object p_date) Get the phase of the moon.int
getQuarter
(Object p_date, TimeZone p_tz) Get the quarter that contains the given date.Get the default server time zone.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getShroveMondayDate
(Object p_obj, TimeZone p_tz) Get the Shrove Monday (Rosenmontag) date in the given year.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getStartOfQuarter
(Object p_date, TimeZone p_tz) Get the start of the quarter that contains the given date.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getStartOfWeek
(Object p_obj, int p_iFirstDayOfWeek, TimeZone p_tz) Get the start of the week that contains the given date.getTimeZone
(de.uplanet.lucy.server.usermanager.IUser p_user) Get the context time zone from the user, or, if not present, the default server time zone.getTimeZone
(String p_strTimeZoneId) Get the specified time zone.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getWhitMondayDate
(Object p_obj, TimeZone p_tz) Get the Whit Monday (Pfingstmontag) date in the given year.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
getWhitSundayDate
(Object p_obj, TimeZone p_tz) Get the Whit Sunday (Pfingstsonntag) date in the given year.boolean
boolean
isLeapYear
(int p_iYear) Determines if the given year is a leap year in the Gregorian Calendar.boolean
de.uplanet.lucy.server.scripting.velocity.util.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.de.uplanet.lucy.server.scripting.velocity.util.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.boolean
Check if the given objects reference the same hour.boolean
Check if the given objects reference the same hour, and minute.boolean
Check if the given objects reference the same hour, minute, and second.boolean
isSameHMSM
(Object p_obj1, Object p_obj2, TimeZone p_tz) Check if the given objects reference the same hour, minute, second, and millisecond.boolean
Check if the given objects reference the same year.boolean
Check if the given objects reference the same year, and month.boolean
Check if the given objects reference the same year, month, and day.boolean
isSaturday
(Object p_date, TimeZone p_tz) boolean
boolean
isThursday
(Object p_date, TimeZone p_tz) boolean
Check if the given object references the same year, month, and day as the current date.boolean
boolean
isWednesday
(Object p_date, TimeZone p_tz) de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Create a date object with the current date and time.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Parse a string with the given format as a date in the given time zone.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Parse a string with the given format as a date in the given time zone.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Parse a string with the given format as a date in the given time zone.de.uplanet.lucy.server.scripting.velocity.util.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.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
parseUTCDate
(String p_strFormat, String p_strDate) Parse a string with the given format as a date in the UTC time zone.de.uplanet.lucy.server.scripting.velocity.util.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.de.uplanet.lucy.server.scripting.velocity.util.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.de.uplanet.lucy.server.scripting.velocity.util.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.sortNullHigh
(List<Object> p_list) Sort the given list of date/time objects with millisecond accuracy.sortNullLow
(List<Object> p_list) Sort the given list of date/time objects with millisecond accuracy.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
utc
(int p_iYear) Create a date object from date fields given in UTC.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
utc
(int p_iYear, int p_iMonth) Create a date object from date fields given in UTC.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
utc
(int p_iYear, int p_iMonth, int p_iDay) Create a date object from date fields given in UTC.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
utc
(int p_iYear, int p_iMonth, int p_iDay, int p_iHour) Create a date object from date fields given in UTC.de.uplanet.lucy.server.scripting.velocity.util.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.de.uplanet.lucy.server.scripting.velocity.util.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.de.uplanet.lucy.server.scripting.velocity.util.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.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
utcNow()
Create a date object with the current date and time.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Wrap the instance in time into aCalendarAwareDate
.de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
Wrap the instance in time into aCalendarAwareDate
.
-
Field Details
-
UTC_ISO_DATE_TIME_FORMAT
The standard ISO UTC formatyyyy-MM-dd'T'HH:mm:ss'Z'
.- See Also:
-
UTC_ISO_DATE_TIME_FORMAT_MILLIS
The standard ISO UTC format with millisecondsyyyy-MM-dd'T'HH:mm:ss.SSS'Z'
.- See Also:
-
DATE_TIME_FORMAT_1
The formatyyyy-MM-dd HH:mm:ss
.- See Also:
-
DATE_TIME_FORMAT_2
The formatyyyy-MM-dd HH:mm
.- See Also:
-
COMPARATOR_DATE_TIME_SORT_NULL_LOW
Compares two date/time objects with millisecond accuracy.null
is sorted low.The comparator accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers,
- calendar objects, and
null
-
COMPARATOR_DATE_TIME_SORT_NULL_HIGH
Compares two date/time objects with millisecond accuracy.null
is sorted high.The comparator accepts mixed
- date objects,
- timestamp objects,
- value holders,
- numbers,
- calendar objects, and
null
-
-
Constructor Details
-
DateTimeUtil
public DateTimeUtil()
-
-
Method Details
-
getServerDefaultTimeZone
Get the default server time zone.- Returns:
- The default time zone.
-
getTimeZone
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
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
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
public de.uplanet.lucy.server.scripting.velocity.util.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_date
argument.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_date
isnull
, or a value holder that does not contain a value, or ifp_tz
isnull
.
-
compareNullLow
Compares two date/time objects with millisecond accuracy.null
is 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
Compares two date/time objects with millisecond accuracy.null
is 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
Sort the given list of date/time objects with millisecond accuracy.null
s 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
Sort the given list of date/time objects with millisecond accuracy.null
s 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 de.uplanet.lucy.server.scripting.velocity.util.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
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 de.uplanet.lucy.server.scripting.velocity.util.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_tz
isnull
.
-
date
public de.uplanet.lucy.server.scripting.velocity.util.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 (0
for January, ...).p_tz
- The time zone to be used.- Returns:
- The newly created date object.
- Throws:
IllegalArgumentException
- Ifp_tz
isnull
.
-
date
public de.uplanet.lucy.server.scripting.velocity.util.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 (0
for January, ...).p_iDay
- The day of month.p_tz
- The time zone to be used.- Returns:
- The newly created date object.
- Throws:
IllegalArgumentException
- Ifp_tz
isnull
.
-
date
public de.uplanet.lucy.server.scripting.velocity.util.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 (0
for 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_tz
isnull
.
-
date
public de.uplanet.lucy.server.scripting.velocity.util.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 (0
for 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_tz
isnull
.
-
date
public de.uplanet.lucy.server.scripting.velocity.util.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 (0
for 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_tz
isnull
.
-
date
public de.uplanet.lucy.server.scripting.velocity.util.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 (0
for 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_tz
isnull
.
-
utc
public de.uplanet.lucy.server.scripting.velocity.util.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 de.uplanet.lucy.server.scripting.velocity.util.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 (0
for January, ...).- Returns:
- The newly created date object.
-
utc
public de.uplanet.lucy.server.scripting.velocity.util.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 (0
for January, ...).p_iDay
- The day of month.- Returns:
- The newly created date object.
-
utc
public de.uplanet.lucy.server.scripting.velocity.util.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 (0
for January, ...).p_iDay
- The day of month.p_iHour
- The hour of day.- Returns:
- The newly created date object.
-
utc
public de.uplanet.lucy.server.scripting.velocity.util.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 (0
for 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 de.uplanet.lucy.server.scripting.velocity.util.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 (0
for 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 de.uplanet.lucy.server.scripting.velocity.util.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 (0
for 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
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:
true
if the given object refers to the the same year, month, and day as the current date, orfalse
otherwise.- Throws:
IllegalArgumentException
- If the given value isnull
, or a value holder that does not contain a value.
-
isSameY
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:
true
if the two objects refer to the the same year, orfalse
otherwise.- Throws:
IllegalArgumentException
- If a given value isnull
, or a value holder that does not contain a value.
-
isSameYM
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:
true
if the two objects refer to the the same year, and month, orfalse
otherwise.- Throws:
IllegalArgumentException
- If a given value isnull
, or a value holder that does not contain a value.
-
isSameYMD
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:
true
if the two objects refer to the the same year, month, and day, orfalse
otherwise.- Throws:
IllegalArgumentException
- If a given value isnull
, or a value holder that does not contain a value.
-
isSameH
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:
true
if the two objects refer to the the same hour, orfalse
otherwise.- Throws:
IllegalArgumentException
- If a given value isnull
, or a value holder that does not contain a value.
-
isSameHM
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:
true
if the two objects refer to the the same hour, and minute, orfalse
otherwise.- Throws:
IllegalArgumentException
- If a given value isnull
, or a value holder that does not contain a value.
-
isSameHMS
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:
true
if the two objects refer to the the same hour, minute, and second, orfalse
otherwise.- Throws:
IllegalArgumentException
- If a given value isnull
, or a value holder that does not contain a value.
-
isSameHMSM
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:
true
if the two objects refer to the the same hour, minute, and second, orfalse
otherwise.- Throws:
IllegalArgumentException
- If a given value isnull
, or a value holder that does not contain a value.
-
isMonday
-
isTuesday
-
isWednesday
-
isThursday
-
isFriday
-
isSaturday
-
isSunday
-
getDifference
public de.uplanet.lucy.server.scripting.velocity.util.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 de.uplanet.lucy.server.scripting.velocity.util.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
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
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
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
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:
true
if the given year is a leap year, orfalse
otherwise.
-
getLunationNumber
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
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
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 (0
for January, ...).p_iDay
- The day of month.- Returns:
- The week number as defined in DIN 1355/ISO 8601.
-
getISO8601WeekNumber
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_date
argument.- 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_tz
isnull
.
-
getISO8601WeekStart
public de.uplanet.lucy.server.scripting.velocity.util.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
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 de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
- Since:
- Intrexx 7.0.
-
getStartOfWeek
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getShroveMondayDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getAshWednesdayDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getMaundyThursdayDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getGoodFridayDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getEasterDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getEasterMondayDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getAscensionDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getWhitSundayDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getWhitMondayDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getPentecostDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getCorpusChristiDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
getPenanceDayDate
public de.uplanet.lucy.server.scripting.velocity.util.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.Timestamp
and as a
.IDateTimeValueHolder
-
dateToISOString
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_date
isnull
.
-
dateToISOStringWithMilliseconds
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_date
isnull
.
-
getDayOfWeekName
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
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
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
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
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_date
orp_tz
isnull
.- Since:
- Intrexx 7.0.
-
getDayOfWeekName
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_date
orp_tz
isnull
.- Since:
- Intrexx 7.0.
-
getDayOfWeekShortName
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_date
orp_tz
isnull
.- Since:
- Intrexx 7.0.
-
getDayOfWeekShortName
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_date
orp_tz
isnull
.- Since:
- Intrexx 7.0.
-
getMonthName
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
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
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
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
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_date
orp_tz
isnull
.- Since:
- Intrexx 7.0.
-
getMonthName
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_date
orp_tz
isnull
.- Since:
- Intrexx 7.0.
-
getMonthShortName
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_date
orp_tz
isnull
.- Since:
- Intrexx 7.0.
-
getMonthShortName
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_date
orp_tz
isnull
.- Since:
- Intrexx 7.0.
-
formatDate
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_date
orp_tz
isnull
.
-
formatDate
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_date
orp_tz
isnull
.
-
isoStringToDate
public de.uplanet.lucy.server.scripting.velocity.util.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
null
if an error occurred while parsing.
-
isoStringToDate
public de.uplanet.lucy.server.scripting.velocity.util.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
null
if an error occurred while parsing. - Throws:
IllegalArgumentException
- Ifp_strDate
isnull
or empty.
-
parseDate
public de.uplanet.lucy.server.scripting.velocity.util.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
null
if an error occurred while parsing. - Throws:
IllegalArgumentException
- Ifp_strFormat
orp_strDate
isnull
or 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 de.uplanet.lucy.server.scripting.velocity.util.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
null
if an error occurred while parsing. - Throws:
IllegalArgumentException
- Ifp_strFormat
orp_strDate
isnull
or empty, or if the given time zone isnull
.- Since:
- Intrexx 7.0.
-
parseDate
public de.uplanet.lucy.server.scripting.velocity.util.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
null
if an error occurred while parsing. - Throws:
IllegalArgumentException
- Ifp_strFormat
orp_strDate
isnull
or empty, or if one the given time zones isnull
.- Since:
- Intrexx 6.0.
-
parseDate
public de.uplanet.lucy.server.scripting.velocity.util.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
null
if an error occurred while parsing. - Throws:
IllegalArgumentException
- Ifp_strFormat
orp_strDate
isnull
or empty, or if one the given time zones isnull
.- Since:
- Intrexx 7.0.
-
parseUTCDate
public de.uplanet.lucy.server.scripting.velocity.util.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
null
if an error occurred while parsing. - Throws:
IllegalArgumentException
- Ifp_strFormat
orp_strDate
isnull
or empty.- Since:
- Intrexx 6.0.
-
parseUTCDate
public de.uplanet.lucy.server.scripting.velocity.util.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
null
if an error occurred while parsing. - Throws:
IllegalArgumentException
- Ifp_strFormat
orp_strDate
isnull
or empty.- Since:
- Intrexx 7.0.
-
parseUTCDate
public de.uplanet.lucy.server.scripting.velocity.util.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
null
if an error occurred while parsing. - Throws:
IllegalArgumentException
- Ifp_strFormat
orp_strDate
isnull
or empty, or if the given time zone isnull
.- Since:
- Intrexx 6.0.
-
parseUTCDate
public de.uplanet.lucy.server.scripting.velocity.util.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
null
if an error occurred while parsing. - Throws:
IllegalArgumentException
- Ifp_strFormat
orp_strDate
isnull
or empty, or if the given time zone isnull
.- Since:
- Intrexx 7.0.
-