Class CalendarAwareDate

java.lang.Object
java.util.Date
java.sql.Timestamp
de.uplanet.lucy.server.scripting.velocity.util.CalendarAwareDate
All Implemented Interfaces:
de.uplanet.lucy.server.dataobjects.IDateTimeValueHolder, IValueHolder<Date>, Serializable, Cloneable, Comparable<Date>

public final class CalendarAwareDate extends Timestamp implements de.uplanet.lucy.server.dataobjects.IDateTimeValueHolder, Cloneable
This class implements a java.sql.Timestamp and a de.uplanet.lucy.server.dataobjects.IDateTimeValueHolder for Velocity scripting. It supports date-time-arithmetics through an aggregated gregorian calendar.

For the user's convenience, methods that modify the underlying date value come in two flavours. One that does not return a value, and one with the same name plus an R-suffix that returns the object itself.

See Also:
  • Field Details

  • Constructor Details

    • CalendarAwareDate

      public CalendarAwareDate(long p_lTime, Calendar p_cal)
      Create a calendar-aware date.

      Note: The given calendar MUST NOT be modified by the caller.

      Parameters:
      p_lTime - The date.
      p_cal - The calendar to be used for calculations.
    • CalendarAwareDate

      public CalendarAwareDate(Date p_dt, Calendar p_cal)
      Create a calendar-aware date.

      Note: The given calendar MUST NOT be modified by the caller.

      Parameters:
      p_dt - The date.
      p_cal - The calendar to be used for calculations.
    • CalendarAwareDate

      public CalendarAwareDate(Timestamp p_ts, Calendar p_cal)
      Create a calendar-aware date.

      Note: The given calendar MUST NOT be modified by the caller.

      Parameters:
      p_ts - The date.
      p_cal - The calendar to be used for calculations.
  • Method Details

    • clone

      public CalendarAwareDate clone()
      Overrides:
      clone in class Date
    • withTimeZone

      public CalendarAwareDate withTimeZone(TimeZone p_tz)
      Create a copy of this date object and associate a calendar with the given time zone with it.
      Parameters:
      p_tz - The time zone.
      Returns:
      The copy with the given time zone.
    • withTimeZone

      public CalendarAwareDate withTimeZone(String p_strTimeZone)
      Create a copy of this date object and associate a calendar with the given time zone with it.
      Parameters:
      p_strTimeZone - The time zone identifier.
      Returns:
      The copy with the given time zone.
    • getYear

      @Deprecated public int getYear()
      Deprecated.
      Use getFullYear() instead.
      Returns a value that is the result of subtracting 1900 from the year, as interpreted in the given time zone.

      A call to this method is effectively equivalent with getFullYear() - 1900.

      Overrides:
      getYear in class Date
      Returns:
      The year represented by this object, minus 1900.
    • setYear

      @Deprecated public void setYear(int p_iValue)
      Deprecated.
      Set the year to the specified value plus 1900, as interpreted in the given time zone.
      Overrides:
      setYear in class Date
      Parameters:
      p_iValue - The value, i.e. The year to be set, minus 1900.
    • getFullYear

      public int getFullYear()
      Get the year, as interpreted in the given time zone.
      Returns:
      The year.
    • setFullYear

      public void setFullYear(int p_iYear)
      Set the year, as interpreted in the given time zone.
      Parameters:
      p_iYear - The year.
    • setFullYearR

      public CalendarAwareDate setFullYearR(int p_iYear)
      Same as setFullYear(int) but returns this object.
      Parameters:
      p_iYear - The year.
      Returns:
      This object.
    • setFullYear

      public void setFullYear(int p_iYear, int p_iMonth)
      Set the year, and month, as interpreted in the given time zone.
      Parameters:
      p_iYear - The year.
      p_iMonth - The (0-based) month.
    • setFullYearR

      public CalendarAwareDate setFullYearR(int p_iYear, int p_iMonth)
      Same as setFullYear(int, int) but returns this object.
      Parameters:
      p_iYear - The year.
      p_iMonth - The (0-based) month.
      Returns:
      This object.
    • setFullYear

      public void setFullYear(int p_iYear, int p_iMonth, int p_iDay)
      Set the year, month, and day, as interpreted in the given time zone.
      Parameters:
      p_iYear - The year.
      p_iMonth - The (0-based) month.
      p_iDay - The (1-based) day of month.
    • setFullYearR

      public CalendarAwareDate setFullYearR(int p_iYear, int p_iMonth, int p_iDay)
      Same as setFullYear(int, int, int) but returns this object.
      Parameters:
      p_iYear - The year.
      p_iMonth - The (0-based) month.
      p_iDay - The (1-based) day of month.
      Returns:
      This object.
    • getUTCFullYear

      public int getUTCFullYear()
      Get the year, as interpreted in the UTC time zone.
      Returns:
      The year.
    • setUTCFullYear

      public void setUTCFullYear(int p_iYear)
      Set the year, as interpreted in the UTC time zone.
      Parameters:
      p_iYear - The year.
    • setUTCFullYearR

      public CalendarAwareDate setUTCFullYearR(int p_iYear)
      Same as setUTCFullYear(int) but returns this object.
      Parameters:
      p_iYear - The year.
      Returns:
      This object.
    • setUTCFullYear

      public void setUTCFullYear(int p_iYear, int p_iMonth)
      Set the year, and month, as interpreted in the UTC time zone.
      Parameters:
      p_iYear - The year.
      p_iMonth - The (0-based) month.
    • setUTCFullYearR

      public CalendarAwareDate setUTCFullYearR(int p_iYear, int p_iMonth)
      Same as setUTCFullYear(int, int) but returns this object.
      Parameters:
      p_iYear - The year.
      p_iMonth - The (0-based) month.
      Returns:
      This object.
    • setUTCFullYear

      public void setUTCFullYear(int p_iYear, int p_iMonth, int p_iDay)
      Set the year, month, and day, as interpreted in the UTC time zone.
      Parameters:
      p_iYear - The year.
      p_iMonth - The (0-based) month.
      p_iDay - The (1-based) day of month.
    • setUTCFullYearR

      public CalendarAwareDate setUTCFullYearR(int p_iYear, int p_iMonth, int p_iDay)
      Same as setUTCFullYear(int, int, int) but returns this object.
      Parameters:
      p_iYear - The year.
      p_iMonth - The (0-based) month.
      p_iDay - The (1-based) day of month.
      Returns:
      This object.
    • getMonth

      public int getMonth()
      Get the (0-based) month, as interpreted in the given time zone.

      0 represents January, ..., 11 represents December.

      Overrides:
      getMonth in class Date
    • setMonth

      public void setMonth(int p_iMonth)
      Set the month, and day, as interpreted in the given time zone.
      Overrides:
      setMonth in class Date
      Parameters:
      p_iMonth - The month. 0 represents January, ..., 11 represents December.
    • setMonthR

      public CalendarAwareDate setMonthR(int p_iMonth)
      Same as setMonth(int) but returns this object.
      Parameters:
      p_iMonth - The month. 0 represents January, ..., 11 represents December.
      Returns:
      This object.
    • setMonth

      public void setMonth(int p_iMonth, int p_iDay)
      Set the month, and day, as interpreted in the given time zone.
      Parameters:
      p_iMonth - The month. 0 represents January, ..., 11 represents December.
      p_iDay - The (1-based) day of month.
    • setMonthR

      public CalendarAwareDate setMonthR(int p_iMonth, int p_iDay)
      Same as setMonth(int, int) but returns this object.
      Parameters:
      p_iMonth - The month. 0 represents January, ..., 11 represents December.
      p_iDay - The (1-based) day of month.
      Returns:
      This object.
    • getUTCMonth

      public int getUTCMonth()
      Get the (0-based) month, as interpreted in the UTC time zone.

      0 represents January, ..., 11 represents December.

    • setUTCMonth

      public void setUTCMonth(int p_iMonth)
      Set the month, and day, as interpreted in the UTC time zone.
      Parameters:
      p_iMonth - The month. 0 represents January, ..., 11 represents December.
    • setUTCMonthR

      public CalendarAwareDate setUTCMonthR(int p_iMonth)
      Same as setUTCMonth(int) but returns this object.
      Parameters:
      p_iMonth - The month. 0 represents January, ..., 11 represents December.
      Returns:
      This object.
    • setUTCMonth

      public void setUTCMonth(int p_iMonth, int p_iDay)
      Set the month, and day, as interpreted in the UTC time zone.
      Parameters:
      p_iMonth - The month. 0 represents January, ..., 11 represents December.
      p_iDay - The (1-based) day of month.
    • setUTCMonthR

      public CalendarAwareDate setUTCMonthR(int p_iMonth, int p_iDay)
      Same as setUTCMonthR(int, int) but returns this object.
      Parameters:
      p_iMonth - The month. 0 represents January, ..., 11 represents December.
      p_iDay - The (1-based) day of month.
      Returns:
      This object.
    • getDay

      @Deprecated public int getDay()
      Deprecated.
      Overrides:
      getDay in class Date
    • getDayEs

      public int getDayEs()
      Get the day of week as specified in ECMA-262 (ECMAScript Language Specification).

      0 specifies Sunday; 1 specifies Monday; 2 specifies Tuesday; 3 specifies Wednesday; 4 specifies Thursday; 5 specifies Friday; and 6 specifies Saturday.

      See also ECMA-262, 15.9.5.16.

      Returns:
      The day of week.
    • getUTCDayEs

      public int getUTCDayEs()
      Get the day of week as specified in ECMA-262 (ECMAScript Language Specification), interpreted in the UTC time zone.

      0 specifies Sunday; 1 specifies Monday; 2 specifies Tuesday; 3 specifies Wednesday; 4 specifies Thursday; 5 specifies Friday; and 6 specifies Saturday.

      See also ECMA-262, 15.9.5.17.

      Returns:
      The day of week.
    • getDayOfWeek

      public int getDayOfWeek()
      Get the (1-based) day of week, as interpreted in the given time zone.
      Returns:
      The day of week.
      See Also:
    • isMonday

      public boolean isMonday()
    • isTuesday

      public boolean isTuesday()
    • isWednesday

      public boolean isWednesday()
    • isThursday

      public boolean isThursday()
    • isFriday

      public boolean isFriday()
    • isSaturday

      public boolean isSaturday()
    • isSunday

      public boolean isSunday()
    • getUTCDayOfWeek

      public int getUTCDayOfWeek()
      Get the (1-based) day of week, as interpreted in the UTC time zone.
      Returns:
      The day of week.
      See Also:
    • isUTCMonday

      public boolean isUTCMonday()
    • isUTCTuesday

      public boolean isUTCTuesday()
    • isUTCWednesday

      public boolean isUTCWednesday()
    • isUTCThursday

      public boolean isUTCThursday()
    • isUTCFriday

      public boolean isUTCFriday()
    • isUTCSaturday

      public boolean isUTCSaturday()
    • isUTCSunday

      public boolean isUTCSunday()
    • getDayOfMonth

      public int getDayOfMonth()
      Get the (1-based) day of month, as interpreted in the given time zone.
      Returns:
      The day of month.
    • setDayOfMonth

      public void setDayOfMonth(int p_iDay)
      Set the (1-based) day of month, as interpreted in the given time zone.
      Parameters:
      p_iDay - The day of month.
    • setDayOfMonthR

      public CalendarAwareDate setDayOfMonthR(int p_iDay)
      Same as setDayOfMonth(int) but returns this object.
      Parameters:
      p_iDay - The day of month.
      Returns:
      This object.
    • getUTCDayOfMonth

      public int getUTCDayOfMonth()
      Get the (1-based) day of month, as interpreted in the UTC time zone.
      Returns:
      The day of month.
    • setUTCDayOfMonth

      public void setUTCDayOfMonth(int p_iDay)
      Set the (1-based) day of month, as interpreted in the UTC time zone.
      Parameters:
      p_iDay - The day of month.
    • setUTCDayOfMonthR

      public CalendarAwareDate setUTCDayOfMonthR(int p_iDay)
      Same as setUTCDayOfMonth(int) but returns this object.
      Parameters:
      p_iDay - The day of month.
      Returns:
      This object.
    • getUTCDate

      public int getUTCDate()
      Get the (1-based) day of month, as interpreted in the UTC time zone.

      See also ECMA-262, 15.9.5.15.

      Returns:
      The day of month.
    • setUTCDate

      public void setUTCDate(int p_iDay)
      Set the (1-based) day of month, as interpreted in the UTC time zone.

      See also ECMA-262, 15.9.5.37.

      Parameters:
      p_iDay - The day of month.
    • setUTCDateR

      public CalendarAwareDate setUTCDateR(int p_iDay)
      Same as setUTCDate(int) but returns this object.
      Parameters:
      p_iDay - The day of month.
      Returns:
      This object.
    • getHours

      public int getHours()
      Get the hour of day, as interpreted in the given time zone.
      Overrides:
      getHours in class Date
      Returns:
      A number from 0 through 23.
    • setHours

      public void setHours(int p_iHours)
      Set the hour of day, as interpreted in the given time zone.
      Overrides:
      setHours in class Date
      Parameters:
      p_iHours - The hour (0 through 23).
    • setHoursR

      public CalendarAwareDate setHoursR(int p_iHours)
      Same as setHours(int) but returns this object.
      Parameters:
      p_iHours - The hour (0 through 23).
      Returns:
      This object.
    • setHours

      public void setHours(int p_iHours, int p_iMinutes)
      Set the hour, and minute, as interpreted in the given time zone.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
    • setHoursR

      public CalendarAwareDate setHoursR(int p_iHours, int p_iMinutes)
      Same as setHours(int, int) but returns this object.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
      Returns:
      This object.
    • setHours

      public void setHours(int p_iHours, int p_iMinutes, int p_iSeconds)
      Set the hour, minute, and second, as interpreted in the given time zone.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
    • setHoursR

      public CalendarAwareDate setHoursR(int p_iHours, int p_iMinutes, int p_iSeconds)
      Same as setHours(int, int, int) but returns this object.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      Returns:
      This object.
    • setHours

      public void setHours(int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Set the hour, minute, second, and milliseconds, as interpreted in the given time zone.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
    • setHoursR

      public CalendarAwareDate setHoursR(int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Same as setHours(int, int, int, int) but returns this object.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
      Returns:
      This object.
    • setToBeginOfDay

      public void setToBeginOfDay()
      Set this date to the begin of day, as interpreted in the given time zone.

      Same as setHours(0, 0, 0, 0).

    • setToBeginOfDayR

      public CalendarAwareDate setToBeginOfDayR()
      Same as setToBeginOfDay() but returns this object.
      Returns:
      This object.
    • setToEndOfDay

      public void setToEndOfDay()
      Set this date to the end of day, as interpreted in the given time zone.

      Same as setHours(24, 0, 0, 0).

    • setToEndOfDayR

      public CalendarAwareDate setToEndOfDayR()
      Same as setToEndOfDay() but returns this object.
      Returns:
      This object.
    • setToStartOfWeek

      public void setToStartOfWeek(int p_iFirstDayOfWeek)
      Set this date to the start of the week, as interpreted in the given time zone.
      Parameters:
      p_iFirstDayOfWeek - The day the weeks starts with (1 for Sunday, 2 for Monday, ..., 7 for Saturday).
    • setToStartOfWeekR

      public CalendarAwareDate setToStartOfWeekR(int p_iFirstDayOfWeek)
      Same as setToStartOfWeek(int) but returns this object.
      Returns:
      This object.
    • getUTCHours

      public int getUTCHours()
      Get the hour of day, as interpreted in the UTC time zone.
      Returns:
      A number from 0 through 23.
    • setUTCHours

      public void setUTCHours(int p_iHours)
      Set the hour of day, as interpreted in the UTC time zone.
      Parameters:
      p_iHours - The hour (0 through 23).
    • setUTCHoursR

      public CalendarAwareDate setUTCHoursR(int p_iHours)
      Same as setUTCHours(int) but returns this object.
      Parameters:
      p_iHours - The hour (0 through 23).
      Returns:
      This object.
    • setUTCHours

      public void setUTCHours(int p_iHours, int p_iMinutes)
      Set the hour, and minute, as interpreted in the UTC time zone.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
    • setUTCHoursR

      public CalendarAwareDate setUTCHoursR(int p_iHours, int p_iMinutes)
      Same as setUTCHours(int, int) but returns this object.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
      Returns:
      This object.
    • setUTCHours

      public void setUTCHours(int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Set the hour, minute, and second, as interpreted in the UTC time zone.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
    • setUTCHoursR

      public CalendarAwareDate setUTCHoursR(int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Same as setUTCHours(int, int, int) but returns this object.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
      Returns:
      This object.
    • setUTCHours

      public void setUTCHours(int p_iHours, int p_iMinutes, int p_iSeconds)
      Set the hour, minute, and second, as interpreted in the UTC time zone.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
    • setUTCHoursR

      public CalendarAwareDate setUTCHoursR(int p_iHours, int p_iMinutes, int p_iSeconds)
      Same as setUTCHours(int, int, int) but returns this object.
      Parameters:
      p_iHours - The hour (0 through 23).
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      Returns:
      This object.
    • setUTCToBeginOfDay

      public void setUTCToBeginOfDay()
      Set this date to the begin of day, as interpreted in the UTC time zone.

      Same as setUTCHours(0, 0, 0, 0).

    • setUTCToBeginOfDayR

      public CalendarAwareDate setUTCToBeginOfDayR()
      Same as setUTCToBeginOfDay() but returns this object.
      Returns:
      This object.
    • setUTCToEndOfDay

      public void setUTCToEndOfDay()
      Set this date to the end of day, as interpreted in the UTC time zone.

      Same as setUTCHours(24, 0, 0, 0).

    • setUTCToEndOfDayR

      public CalendarAwareDate setUTCToEndOfDayR()
      Same as setUTCToEndOfDay() but returns this object.
      Returns:
      This object.
    • getMinutes

      public int getMinutes()
      Get the minute, as interpreted in the given time zone.
      Overrides:
      getMinutes in class Date
      Returns:
      The minute.
    • setMinutes

      public void setMinutes(int p_iMinutes)
      Set the minute, as interpreted in the given time zone.
      Overrides:
      setMinutes in class Date
      Parameters:
      p_iMinutes - The minutes.
    • setMinutesR

      public CalendarAwareDate setMinutesR(int p_iMinutes)
      Same as setMinutes(int) but returns this object.
      Parameters:
      p_iMinutes - The minutes.
      Returns:
      This object.
    • setMinutes

      public void setMinutes(int p_iMinutes, int p_iSeconds)
      Set the minute, and second, as interpreted in the given time zone.
      Parameters:
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
    • setMinutesR

      public CalendarAwareDate setMinutesR(int p_iMinutes, int p_iSeconds)
      Same as setMinutes(int, int) but returns this object.
      Parameters:
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      Returns:
      This object.
    • setMinutes

      public void setMinutes(int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Set the minute, second, and milliseconds, as interpreted in the given time zone.
      Parameters:
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
    • setMinutesR

      public CalendarAwareDate setMinutesR(int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Same as setMinutes(int, int, int) but returns this object.
      Parameters:
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
      Returns:
      This object.
    • getUTCMinutes

      public int getUTCMinutes()
      Get the minute, as interpreted in the UTC time zone.
      Returns:
      The minute.
    • setUTCMinutes

      public void setUTCMinutes(int p_iMinutes)
      Set the minute, as interpreted in the UTC time zone.
      Parameters:
      p_iMinutes - The minutes.
    • setUTCMinutesR

      public CalendarAwareDate setUTCMinutesR(int p_iMinutes)
      Same as setUTCMinutes(int) but returns this object.
      Parameters:
      p_iMinutes - The minutes.
      Returns:
      This object.
    • setUTCMinutes

      public void setUTCMinutes(int p_iMinutes, int p_iSeconds)
      Set the minute, and second, as interpreted in the UTC time zone.
      Parameters:
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
    • setUTCMinutesR

      public CalendarAwareDate setUTCMinutesR(int p_iMinutes, int p_iSeconds)
      Same as setUTCMinutes(int, int) but returns this object.
      Parameters:
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      Returns:
      This object.
    • setUTCMinutes

      public void setUTCMinutes(int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Set the minute, second, and milliseconds, as interpreted in the UTC time zone.
      Parameters:
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
    • setUTCMinutesR

      public CalendarAwareDate setUTCMinutesR(int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Same as setUTCMinutes(int, int, int) but returns this object.
      Parameters:
      p_iMinutes - The minutes.
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
      Returns:
      This object.
    • getSeconds

      public int getSeconds()
      Get the seconds, as interpreted in the given time zone.
      Overrides:
      getSeconds in class Date
      Returns:
      The seconds.
    • setSeconds

      public void setSeconds(int p_iSeconds)
      Set the seconds, as interpreted in the given time zone.
      Overrides:
      setSeconds in class Date
      Parameters:
      p_iSeconds - The seconds.
    • setSecondsR

      public CalendarAwareDate setSecondsR(int p_iSeconds)
      Same as setSeconds(int) but returns this object.
      Parameters:
      p_iSeconds - The seconds.
      Returns:
      This object.
    • setSeconds

      public void setSeconds(int p_iSeconds, int p_iMilliseconds)
      Set the second, and milliseconds, as interpreted in the given time zone.
      Parameters:
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
    • setSecondsR

      public CalendarAwareDate setSecondsR(int p_iSeconds, int p_iMilliseconds)
      Same as setSeconds(int, int) but returns this object.
      Parameters:
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
      Returns:
      This object.
    • getUTCSeconds

      public int getUTCSeconds()
      Get the seconds, as interpreted in the UTC time zone.
      Returns:
      The seconds.
    • setUTCSeconds

      public void setUTCSeconds(int p_iSeconds)
      Set the seconds, as interpreted in the UTC time zone.
      Parameters:
      p_iSeconds - The seconds.
    • setUTCSecondsR

      public CalendarAwareDate setUTCSecondsR(int p_iSeconds)
      Same as setUTCSeconds(int) but returns this object.
      Parameters:
      p_iSeconds - The seconds.
      Returns:
      This object.
    • setUTCSeconds

      public void setUTCSeconds(int p_iSeconds, int p_iMilliseconds)
      Set the second, and milliseconds, as interpreted in the UTC time zone.
      Parameters:
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
    • setUTCSecondsR

      public CalendarAwareDate setUTCSecondsR(int p_iSeconds, int p_iMilliseconds)
      Same as setUTCSeconds(int, int) but returns this object.
      Parameters:
      p_iSeconds - The seconds.
      p_iMilliseconds - The milliseconds.
      Returns:
      This object.
    • getMilliseconds

      public int getMilliseconds()
      Get the milliseconds, as interpreted in the given time zone.
      Returns:
      The milliseconds.
    • setMilliseconds

      public void setMilliseconds(int p_iMilliseconds)
      Set the milliseconds, as interpreted in the given time zone.
      Parameters:
      p_iMilliseconds - The milliseconds.
    • setMillisecondsR

      public CalendarAwareDate setMillisecondsR(int p_iMilliseconds)
      Same as setMilliseconds(int) but returns this object.
      Parameters:
      p_iMilliseconds - The milliseconds.
      Returns:
      This object.
    • getUTCMilliseconds

      public int getUTCMilliseconds()
      Get the milliseconds, as interpreted in the UTC time zone.
      Returns:
      The milliseconds.
    • setUTCMilliseconds

      public void setUTCMilliseconds(int p_iMilliseconds)
      Set the milliseconds, as interpreted in the UTC time zone.
      Parameters:
      p_iMilliseconds - The milliseconds.
    • setUTCMillisecondsR

      public CalendarAwareDate setUTCMillisecondsR(int p_iMilliseconds)
      Same as setUTCMilliseconds(int) but returns this object.
      Parameters:
      p_iMilliseconds - The milliseconds.
      Returns:
      This object.
    • addMilliseconds

      public void addMilliseconds(long p_lMilliseconds)
      Add the given number of milliseconds to the underlying value that represents this instance in time.

      Note that this calculation does not involve any calendar semantics.

      Parameters:
      p_lMilliseconds - The number of milliseconds to be added.
    • addMillisecondsR

      public CalendarAwareDate addMillisecondsR(long p_lMilliseconds)
      Same as addMilliseconds(long) but returns this object.
      Parameters:
      p_lMilliseconds - The number of milliseconds to be added.
      Returns:
      This object.
    • subMilliseconds

      public void subMilliseconds(long p_lMilliseconds)
      Subtract the given number of milliseconds to the underlying value that represents this instance in time.

      Note that this calculation does not involve any calendar semantics.

      Parameters:
      p_lMilliseconds - The number of milliseconds to be subtracted.
    • subMillisecondsR

      public CalendarAwareDate subMillisecondsR(long p_lMillis)
      Same as subMilliseconds(long) but returns this object.
      Parameters:
      p_lMillis - The number of milliseconds to be subtracted.
      Returns:
      This object.
    • addYears

      public void addYears(int p_iYears)
      Add to this date.
    • addYearsR

      public CalendarAwareDate addYearsR(int p_iYears)
      Same as addYears(int) but returns this object.
      Returns:
      This object.
    • subYears

      public void subYears(int p_iYears)
      Subtract from this date.
    • subYearsR

      public CalendarAwareDate subYearsR(int p_iYears)
      Same as addYears(int) but returns this object.
      Returns:
      This object.
    • addMonths

      public void addMonths(int p_iMonths)
      Add to this date.
    • addMonthsR

      public CalendarAwareDate addMonthsR(int p_iMonths)
      Same as addMonths(int) but returns this object.
      Returns:
      This object.
    • subMonths

      public void subMonths(int p_iMonths)
      Subtract from this date.
    • subMonthsR

      public CalendarAwareDate subMonthsR(int p_iMonths)
      Same as subMonths(int) but returns this object.
      Returns:
      This object.
    • addDays

      public void addDays(int p_iDays)
      Add to this date.
    • addDaysR

      public CalendarAwareDate addDaysR(int p_iDays)
      Add to this date.
      Returns:
      This object.
    • addDays

      public void addDays(int p_iDays, int p_iHours)
      Add to this date.
    • addDaysR

      public CalendarAwareDate addDaysR(int p_iDays, int p_iHours)
      Add to this date.
      Returns:
      This object.
    • addDays

      public void addDays(int p_iDays, int p_iHours, int p_iMinutes)
      Add to this date.
    • addDaysR

      public CalendarAwareDate addDaysR(int p_iDays, int p_iHours, int p_iMinutes)
      Add to this date.
      Returns:
      This object.
    • addDays

      public void addDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
      Add to this date.
    • addDaysR

      public CalendarAwareDate addDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
      Add to this date.
      Returns:
      This object.
    • addDays

      public void addDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Add to this date.
    • addDaysR

      public CalendarAwareDate addDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Add to this date.
      Returns:
      This object.
    • subDays

      public void subDays(int p_iDays)
      Subtract from this date.
    • subDaysR

      public CalendarAwareDate subDaysR(int p_iDays)
      Subtract from this date.
      Returns:
      This object.
    • subDays

      public void subDays(int p_iDays, int p_iHours)
      Subtract from this date.
    • subDaysR

      public CalendarAwareDate subDaysR(int p_iDays, int p_iHours)
      Subtract from this date.
      Returns:
      This object.
    • subDays

      public void subDays(int p_iDays, int p_iHours, int p_iMinutes)
      Subtract from this date.
    • subDaysR

      public CalendarAwareDate subDaysR(int p_iDays, int p_iHours, int p_iMinutes)
      Subtract from this date.
      Returns:
      This object.
    • subDays

      public void subDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
      Subtract from this date.
    • subDaysR

      public CalendarAwareDate subDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
      Subtract from this date.
      Returns:
      This object.
    • subDays

      public void subDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Subtract from this date.
    • subDaysR

      public CalendarAwareDate subDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Subtract from this date.
      Returns:
      This object.
    • addUTCYears

      public void addUTCYears(int p_iYears)
      Add to this date.
    • addUTCYearsR

      public CalendarAwareDate addUTCYearsR(int p_iYears)
      Add to this date.
      Returns:
      This object.
    • subUTCYears

      public void subUTCYears(int p_iYears)
      Subtract from this date.
    • subUTCYearsR

      public CalendarAwareDate subUTCYearsR(int p_iYears)
      Subtract from this date.
      Returns:
      This object.
    • addUTCMonths

      public void addUTCMonths(int p_iMonths)
      Add to this date.
    • addUTCMonthsR

      public CalendarAwareDate addUTCMonthsR(int p_iMonths)
      Add to this date.
      Returns:
      This object.
    • subUTCMonths

      public void subUTCMonths(int p_iMonths)
      Subtract from this date.
    • subUTCMonthsR

      public CalendarAwareDate subUTCMonthsR(int p_iMonths)
      Subtract from this date.
      Returns:
      This object.
    • addUTCDays

      public void addUTCDays(int p_iDays)
      Add to this date.
    • addUTCDaysR

      public CalendarAwareDate addUTCDaysR(int p_iDays)
      Add to this date.
      Returns:
      This object.
    • addUTCDays

      public void addUTCDays(int p_iDays, int p_iHours)
      Add to this date.
    • addUTCDaysR

      public CalendarAwareDate addUTCDaysR(int p_iDays, int p_iHours)
      Add to this date.
      Returns:
      This object.
    • addUTCDays

      public void addUTCDays(int p_iDays, int p_iHours, int p_iMinutes)
      Add to this date.
    • addUTCDaysR

      public CalendarAwareDate addUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes)
      Add to this date.
      Returns:
      This object.
    • addUTCDays

      public void addUTCDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
      Add to this date.
    • addUTCDaysR

      public CalendarAwareDate addUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
      Add to this date.
      Returns:
      This object.
    • addUTCDays

      public void addUTCDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Add to this date.
    • addUTCDaysR

      public CalendarAwareDate addUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Add to this date.
      Returns:
      This object.
    • subUTCDays

      public void subUTCDays(int p_iDays)
      Subtract from this date.
    • subUTCDaysR

      public CalendarAwareDate subUTCDaysR(int p_iDays)
      Subtract from this date.
      Returns:
      This object.
    • subUTCDays

      public void subUTCDays(int p_iDays, int p_iHours)
      Subtract from this date.
    • subUTCDaysR

      public CalendarAwareDate subUTCDaysR(int p_iDays, int p_iHours)
      Subtract from this date.
      Returns:
      This object.
    • subUTCDays

      public void subUTCDays(int p_iDays, int p_iHours, int p_iMinutes)
      Subtract from this date.
    • subUTCDaysR

      public CalendarAwareDate subUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes)
      Subtract from this date.
      Returns:
      This object.
    • subUTCDays

      public void subUTCDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
      Subtract from this date.
    • subUTCDaysR

      public CalendarAwareDate subUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
      Subtract from this date.
      Returns:
      This object.
    • subUTCDays

      public void subUTCDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Subtract from this date.
    • subUTCDaysR

      public CalendarAwareDate subUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
      Subtract from this date.
      Returns:
      This object.
    • modify

      public void modify(String p_strRules)
      Modify this date according to the rules specified in the p_strRules parameter in the given time zone.

      The rules consist of up to seven rules for each of the calendar fields YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND, in that order, and separated by commas. Each rule specifies either a positive or negative offset (e.g. -1, or +1), or an absolute value for the field (e.g. 15). Other than in the Java Calendar API, the month values are 1-based, i.e. 1 = January, 2 = February, ...

      Example:
      +1,1,1,12,30,0,0 means the given date plus one year, the first of January, 12:30:00.0 on the 24-hour clock.

      Parameters:
      p_strRules - The rules (must not be null or empty).
      Throws:
      IllegalArgumentException - If p_strRules is null or empty.
    • modifyR

      public CalendarAwareDate modifyR(String p_strRules)
      Same as modify(String) but returns this object.
      Returns:
      This object.
    • modify

      public void modify(String p_strRules, boolean p_bClearMillis)
      Modify this date according to the rules specified in the p_strRules parameter in the given time zone.

      The rules consist of up to seven rules for each of the calendar fields YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND, in that order, and separated by commas. Each rule specifies either a positive or negative offset (e.g. -1, or +1), or an absolute value for the field (e.g. 15). Other than in the Java Calendar API, the month values are 1-based, i.e. 1 = January, 2 = February, ...

      Example:
      +1,1,1,12,30,0,0 means the given date plus one year, the first of January, 12:30:00.0 on the 24-hour clock.

      Parameters:
      p_strRules - The rules (must not be null or empty).
      p_bClearMillis - true if the calendar's millisecond field should be set to zero if the rule does not specify the millisecond field, or false otherwise.
      Throws:
      IllegalArgumentException - If p_strRules is null or empty.
    • modifyR

      public CalendarAwareDate modifyR(String p_strRules, boolean p_bClearMillis)
      Same as modify(String, boolean) but returns this object.
      Returns:
      This object.
    • modifyUTC

      public void modifyUTC(String p_strRules)
      Modify this date according to the rules specified in the p_strRules parameter in the UTC time zone.

      The rules consist of up to seven rules for each of the calendar fields YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND, in that order, and separated by commas. Each rule specifies either a positive or negative offset (e.g. -1, or +1), or an absolute value for the field (e.g. 15). Other than in the Java Calendar API, the month values are 1-based, i.e. 1 = January, 2 = February, ...

      Example:
      +1,1,1,12,30,0,0 means the given date plus one year, the first of January, 12:30:00.0 on the 24-hour clock.

      Parameters:
      p_strRules - The rules (must not be null or empty).
      Throws:
      IllegalArgumentException - If p_strRules is null or empty.
    • modifyUTCR

      public CalendarAwareDate modifyUTCR(String p_strRules)
      Same as modifyUTC(String) but returns this object.
      Returns:
      This object.
    • modifyUTC

      public void modifyUTC(String p_strRules, boolean p_bClearMillis)
      Modify this date according to the rules specified in the p_strRules parameter in the given time zone.

      The rules consist of up to seven rules for each of the calendar fields YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY, MINUTE, SECOND, and MILLISECOND, in that order, and separated by commas. Each rule specifies either a positive or negative offset (e.g. -1, or +1), or an absolute value for the field (e.g. 15). Other than in the Java Calendar API, the month values are 1-based, i.e. 1 = January, 2 = February, ...

      Example:
      +1,1,1,12,30,0,0 means the given date plus one year, the first of January, 12:30:00.0 on the 24-hour clock.

      Parameters:
      p_strRules - The rules (must not be null or empty).
      p_bClearMillis - true if the calendar's millisecond field should be set to zero if the rule does not specify the millisecond field, or false otherwise.
      Throws:
      IllegalArgumentException - If p_strRules is null or empty.
    • modifyUTCR

      public CalendarAwareDate modifyUTCR(String p_strRules, boolean p_bClearMillis)
      Same as modifyUTC(String, boolean) but returns this object.
      Returns:
      This object.
    • toUTCString

      public String toUTCString()
      Return a human-readable string that represents this date object, in UTC.

      See also ECMA-262, 15.9.5.42.

      Returns:
      A human-readable UTC date literal.
    • toJSON

      public String toJSON()
      Return string that represents this date object jsonified.

      The format is "yyyy-MM-dd'T'HH:mm:ss'Z'".

      See also ECMA-262, 15.9.5.44.

      Returns:
      A JSON compatible date literal.
    • format

      public String format(String p_strFormat)
      Format this date using the given simple date format in the given time zone.
      Parameters:
      p_strFormat - The simple date format.
      Returns:
      The formatted date.
    • format

      public String format(String p_strFormat, String p_strLocaleId)
      Format this date using the given simple date format in the given time zone.
      Parameters:
      p_strFormat - The simple date format.
      p_strLocaleId - The ID (language tag) of the locale to be used.
      Returns:
      The formatted date.
    • formatUTC

      public String formatUTC(String p_strFormat)
      Format this date using the given simple date format in the UTC time zone.
      Parameters:
      p_strFormat - The simple date format.
      Returns:
      The formatted date.
    • formatUTC

      public String formatUTC(String p_strFormat, String p_strLocaleId)
      Format this date using the given simple date format in the UTC time zone.
      Parameters:
      p_strFormat - The simple date format.
      p_strLocaleId - The ID (language tag) of the locale to be used.
      Returns:
      The formatted date.
    • getType

      public QName getType()
      Description copied from interface: IValueHolder
      The type of data this value holder holds.
      Specified by:
      getType in interface IValueHolder<Date>
      Returns:
      IxDatatype.DATETIME.
    • getValue

      public Date getValue()
      Description copied from interface: IValueHolder
      Get the data that this value holder holds.

      Implementations MUST ensure that multiple calls to this method will return values that equal each other.

      Specified by:
      getValue in interface IValueHolder<Date>
      Returns:
      The data.
    • getRawValue

      public Object getRawValue()
      Description copied from interface: IValueHolder
      Get the raw data that this value holder holds.
      Specified by:
      getRawValue in interface IValueHolder<Date>
      Returns:
      The raw data.
    • hasValue

      public boolean hasValue()
      Description copied from interface: IValueHolder
      Check if this value holder currently holds data or not.
      Specified by:
      hasValue in interface IValueHolder<Date>
      Returns:
      true if the data holder holds data, or false otherwise.
    • getCanonicalLexicalRepresentation

      public String getCanonicalLexicalRepresentation()
      Description copied from interface: IValueHolder
      Get the canonical lexical representation of this value according to it's datatype.
      Specified by:
      getCanonicalLexicalRepresentation in interface IValueHolder<Date>
      Returns:
      The canonical lexical representation of the current date.
      See Also:
      • Convert.getCanonicalLexicalRepresentationDateTime(Date)
    • asTime

      public ChimeraDate asTime()
      Get the current time, i.e. the instance in time with its date set to zero 1970-01-01 in the UTC time zone.
      Returns:
      The current time.
    • unwrap

      public ChimeraDate unwrap()