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 ajava.sql.Timestamp
and ade.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CalendarAwareDate(long p_lTime, Calendar p_cal)
Create a calendar-aware date.CalendarAwareDate(Timestamp p_ts, Calendar p_cal)
Create a calendar-aware date.CalendarAwareDate(Date p_dt, Calendar p_cal)
Create a calendar-aware date.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addDays(int p_iDays)
Add to this date.void
addDays(int p_iDays, int p_iHours)
Add to this date.void
addDays(int p_iDays, int p_iHours, int p_iMinutes)
Add to this date.void
addDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
Add to this date.void
addDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Add to this date.CalendarAwareDate
addDaysR(int p_iDays)
Add to this date.CalendarAwareDate
addDaysR(int p_iDays, int p_iHours)
Add to this date.CalendarAwareDate
addDaysR(int p_iDays, int p_iHours, int p_iMinutes)
Add to this date.CalendarAwareDate
addDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
Add to this date.CalendarAwareDate
addDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Add to this date.void
addMilliseconds(long p_lMilliseconds)
Add the given number of milliseconds to the underlying value that represents this instance in time.CalendarAwareDate
addMillisecondsR(long p_lMilliseconds)
Same asaddMilliseconds(long)
but returns this object.void
addMonths(int p_iMonths)
Add to this date.CalendarAwareDate
addMonthsR(int p_iMonths)
Same asaddMonths(int)
but returns this object.void
addUTCDays(int p_iDays)
Add to this date.void
addUTCDays(int p_iDays, int p_iHours)
Add to this date.void
addUTCDays(int p_iDays, int p_iHours, int p_iMinutes)
Add to this date.void
addUTCDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
Add to this date.void
addUTCDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Add to this date.CalendarAwareDate
addUTCDaysR(int p_iDays)
Add to this date.CalendarAwareDate
addUTCDaysR(int p_iDays, int p_iHours)
Add to this date.CalendarAwareDate
addUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes)
Add to this date.CalendarAwareDate
addUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
Add to this date.CalendarAwareDate
addUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Add to this date.void
addUTCMonths(int p_iMonths)
Add to this date.CalendarAwareDate
addUTCMonthsR(int p_iMonths)
Add to this date.void
addUTCYears(int p_iYears)
Add to this date.CalendarAwareDate
addUTCYearsR(int p_iYears)
Add to this date.void
addYears(int p_iYears)
Add to this date.CalendarAwareDate
addYearsR(int p_iYears)
Same asaddYears(int)
but returns this object.ChimeraDate
asTime()
Get the current time, i.e.CalendarAwareDate
clone()
String
format(String p_strFormat)
Format this date using the given simple date format in the given time zone.String
format(String p_strFormat, String p_strLocaleId)
Format this date using the given simple date format in the given time zone.String
formatUTC(String p_strFormat)
Format this date using the given simple date format in the UTC time zone.String
formatUTC(String p_strFormat, String p_strLocaleId)
Format this date using the given simple date format in the UTC time zone.String
getCanonicalLexicalRepresentation()
Get the canonical lexical representation of this value according to it's datatype.int
getDay()
Deprecated.int
getDayEs()
Get the day of week as specified in ECMA-262 (ECMAScript Language Specification).int
getDayOfMonth()
Get the (1-based) day of month, as interpreted in the given time zone.int
getDayOfWeek()
Get the (1-based) day of week, as interpreted in the given time zone.int
getFullYear()
Get the year, as interpreted in the given time zone.int
getHours()
Get the hour of day, as interpreted in the given time zone.int
getMilliseconds()
Get the milliseconds, as interpreted in the given time zone.int
getMinutes()
Get the minute, as interpreted in the given time zone.int
getMonth()
Get the (0-based) month, as interpreted in the given time zone.Object
getRawValue()
Get the raw data that this value holder holds.int
getSeconds()
Get the seconds, as interpreted in the given time zone.QName
getType()
The type of data this value holder holds.int
getUTCDate()
Get the (1-based) day of month, as interpreted in the UTC time zone.int
getUTCDayEs()
Get the day of week as specified in ECMA-262 (ECMAScript Language Specification), interpreted in the UTC time zone.int
getUTCDayOfMonth()
Get the (1-based) day of month, as interpreted in the UTC time zone.int
getUTCDayOfWeek()
Get the (1-based) day of week, as interpreted in the UTC time zone.int
getUTCFullYear()
Get the year, as interpreted in the UTC time zone.int
getUTCHours()
Get the hour of day, as interpreted in the UTC time zone.int
getUTCMilliseconds()
Get the milliseconds, as interpreted in the UTC time zone.int
getUTCMinutes()
Get the minute, as interpreted in the UTC time zone.int
getUTCMonth()
Get the (0-based) month, as interpreted in the UTC time zone.int
getUTCSeconds()
Get the seconds, as interpreted in the UTC time zone.Date
getValue()
Get the data that this value holder holds.int
getYear()
Deprecated.UsegetFullYear()
instead.boolean
hasValue()
Check if this value holder currently holds data or not.boolean
isFriday()
boolean
isMonday()
boolean
isSaturday()
boolean
isSunday()
boolean
isThursday()
boolean
isTuesday()
boolean
isUTCFriday()
boolean
isUTCMonday()
boolean
isUTCSaturday()
boolean
isUTCSunday()
boolean
isUTCThursday()
boolean
isUTCTuesday()
boolean
isUTCWednesday()
boolean
isWednesday()
void
modify(String p_strRules)
Modify this date according to the rules specified in thep_strRules
parameter in the given time zone.void
modify(String p_strRules, boolean p_bClearMillis)
Modify this date according to the rules specified in thep_strRules
parameter in the given time zone.CalendarAwareDate
modifyR(String p_strRules)
Same asmodify(String)
but returns this object.CalendarAwareDate
modifyR(String p_strRules, boolean p_bClearMillis)
Same asmodify(String, boolean)
but returns this object.void
modifyUTC(String p_strRules)
Modify this date according to the rules specified in thep_strRules
parameter in the UTC time zone.void
modifyUTC(String p_strRules, boolean p_bClearMillis)
Modify this date according to the rules specified in thep_strRules
parameter in the given time zone.CalendarAwareDate
modifyUTCR(String p_strRules)
Same asmodifyUTC(String)
but returns this object.CalendarAwareDate
modifyUTCR(String p_strRules, boolean p_bClearMillis)
Same asmodifyUTC(String, boolean)
but returns this object.void
setDayOfMonth(int p_iDay)
Set the (1-based) day of month, as interpreted in the given time zone.CalendarAwareDate
setDayOfMonthR(int p_iDay)
Same assetDayOfMonth(int)
but returns this object.void
setFullYear(int p_iYear)
Set the year, as interpreted in the given time zone.void
setFullYear(int p_iYear, int p_iMonth)
Set the year, and month, as interpreted in the given time zone.void
setFullYear(int p_iYear, int p_iMonth, int p_iDay)
Set the year, month, and day, as interpreted in the given time zone.CalendarAwareDate
setFullYearR(int p_iYear)
Same assetFullYear(int)
but returns this object.CalendarAwareDate
setFullYearR(int p_iYear, int p_iMonth)
Same assetFullYear(int, int)
but returns this object.CalendarAwareDate
setFullYearR(int p_iYear, int p_iMonth, int p_iDay)
Same assetFullYear(int, int, int)
but returns this object.void
setHours(int p_iHours)
Set the hour of day, as interpreted in the given time zone.void
setHours(int p_iHours, int p_iMinutes)
Set the hour, and minute, as interpreted in the given time zone.void
setHours(int p_iHours, int p_iMinutes, int p_iSeconds)
Set the hour, minute, and second, as interpreted in the given time zone.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.CalendarAwareDate
setHoursR(int p_iHours)
Same assetHours(int)
but returns this object.CalendarAwareDate
setHoursR(int p_iHours, int p_iMinutes)
Same assetHours(int, int)
but returns this object.CalendarAwareDate
setHoursR(int p_iHours, int p_iMinutes, int p_iSeconds)
Same assetHours(int, int, int)
but returns this object.CalendarAwareDate
setHoursR(int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Same assetHours(int, int, int, int)
but returns this object.void
setMilliseconds(int p_iMilliseconds)
Set the milliseconds, as interpreted in the given time zone.CalendarAwareDate
setMillisecondsR(int p_iMilliseconds)
Same assetMilliseconds(int)
but returns this object.void
setMinutes(int p_iMinutes)
Set the minute, as interpreted in the given time zone.void
setMinutes(int p_iMinutes, int p_iSeconds)
Set the minute, and second, as interpreted in the given time zone.void
setMinutes(int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Set the minute, second, and milliseconds, as interpreted in the given time zone.CalendarAwareDate
setMinutesR(int p_iMinutes)
Same assetMinutes(int)
but returns this object.CalendarAwareDate
setMinutesR(int p_iMinutes, int p_iSeconds)
Same assetMinutes(int, int)
but returns this object.CalendarAwareDate
setMinutesR(int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Same assetMinutes(int, int, int)
but returns this object.void
setMonth(int p_iMonth)
Set the month, and day, as interpreted in the given time zone.void
setMonth(int p_iMonth, int p_iDay)
Set the month, and day, as interpreted in the given time zone.CalendarAwareDate
setMonthR(int p_iMonth)
Same assetMonth(int)
but returns this object.CalendarAwareDate
setMonthR(int p_iMonth, int p_iDay)
Same assetMonth(int, int)
but returns this object.void
setSeconds(int p_iSeconds)
Set the seconds, as interpreted in the given time zone.void
setSeconds(int p_iSeconds, int p_iMilliseconds)
Set the second, and milliseconds, as interpreted in the given time zone.CalendarAwareDate
setSecondsR(int p_iSeconds)
Same assetSeconds(int)
but returns this object.CalendarAwareDate
setSecondsR(int p_iSeconds, int p_iMilliseconds)
Same assetSeconds(int, int)
but returns this object.void
setToBeginOfDay()
Set this date to the begin of day, as interpreted in the given time zone.CalendarAwareDate
setToBeginOfDayR()
Same assetToBeginOfDay()
but returns this object.void
setToEndOfDay()
Set this date to the end of day, as interpreted in the given time zone.CalendarAwareDate
setToEndOfDayR()
Same assetToEndOfDay()
but returns this object.void
setToStartOfWeek(int p_iFirstDayOfWeek)
Set this date to the start of the week, as interpreted in the given time zone.CalendarAwareDate
setToStartOfWeekR(int p_iFirstDayOfWeek)
Same assetToStartOfWeek(int)
but returns this object.void
setUTCDate(int p_iDay)
Set the (1-based) day of month, as interpreted in the UTC time zone.CalendarAwareDate
setUTCDateR(int p_iDay)
Same assetUTCDate(int)
but returns this object.void
setUTCDayOfMonth(int p_iDay)
Set the (1-based) day of month, as interpreted in the UTC time zone.CalendarAwareDate
setUTCDayOfMonthR(int p_iDay)
Same assetUTCDayOfMonth(int)
but returns this object.void
setUTCFullYear(int p_iYear)
Set the year, as interpreted in the UTC time zone.void
setUTCFullYear(int p_iYear, int p_iMonth)
Set the year, and month, as interpreted in the UTC time zone.void
setUTCFullYear(int p_iYear, int p_iMonth, int p_iDay)
Set the year, month, and day, as interpreted in the UTC time zone.CalendarAwareDate
setUTCFullYearR(int p_iYear)
Same assetUTCFullYear(int)
but returns this object.CalendarAwareDate
setUTCFullYearR(int p_iYear, int p_iMonth)
Same assetUTCFullYear(int, int)
but returns this object.CalendarAwareDate
setUTCFullYearR(int p_iYear, int p_iMonth, int p_iDay)
Same assetUTCFullYear(int, int, int)
but returns this object.void
setUTCHours(int p_iHours)
Set the hour of day, as interpreted in the UTC time zone.void
setUTCHours(int p_iHours, int p_iMinutes)
Set the hour, and minute, as interpreted in the UTC time zone.void
setUTCHours(int p_iHours, int p_iMinutes, int p_iSeconds)
Set the hour, minute, and second, as interpreted in the UTC time zone.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.CalendarAwareDate
setUTCHoursR(int p_iHours)
Same assetUTCHours(int)
but returns this object.CalendarAwareDate
setUTCHoursR(int p_iHours, int p_iMinutes)
Same assetUTCHours(int, int)
but returns this object.CalendarAwareDate
setUTCHoursR(int p_iHours, int p_iMinutes, int p_iSeconds)
Same assetUTCHours(int, int, int)
but returns this object.CalendarAwareDate
setUTCHoursR(int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Same assetUTCHours(int, int, int)
but returns this object.void
setUTCMilliseconds(int p_iMilliseconds)
Set the milliseconds, as interpreted in the UTC time zone.CalendarAwareDate
setUTCMillisecondsR(int p_iMilliseconds)
Same assetUTCMilliseconds(int)
but returns this object.void
setUTCMinutes(int p_iMinutes)
Set the minute, as interpreted in the UTC time zone.void
setUTCMinutes(int p_iMinutes, int p_iSeconds)
Set the minute, and second, as interpreted in the UTC time zone.void
setUTCMinutes(int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Set the minute, second, and milliseconds, as interpreted in the UTC time zone.CalendarAwareDate
setUTCMinutesR(int p_iMinutes)
Same assetUTCMinutes(int)
but returns this object.CalendarAwareDate
setUTCMinutesR(int p_iMinutes, int p_iSeconds)
Same assetUTCMinutes(int, int)
but returns this object.CalendarAwareDate
setUTCMinutesR(int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Same assetUTCMinutes(int, int, int)
but returns this object.void
setUTCMonth(int p_iMonth)
Set the month, and day, as interpreted in the UTC time zone.void
setUTCMonth(int p_iMonth, int p_iDay)
Set the month, and day, as interpreted in the UTC time zone.CalendarAwareDate
setUTCMonthR(int p_iMonth)
Same assetUTCMonth(int)
but returns this object.CalendarAwareDate
setUTCMonthR(int p_iMonth, int p_iDay)
Same assetUTCMonthR(int, int)
but returns this object.void
setUTCSeconds(int p_iSeconds)
Set the seconds, as interpreted in the UTC time zone.void
setUTCSeconds(int p_iSeconds, int p_iMilliseconds)
Set the second, and milliseconds, as interpreted in the UTC time zone.CalendarAwareDate
setUTCSecondsR(int p_iSeconds)
Same assetUTCSeconds(int)
but returns this object.CalendarAwareDate
setUTCSecondsR(int p_iSeconds, int p_iMilliseconds)
Same assetUTCSeconds(int, int)
but returns this object.void
setUTCToBeginOfDay()
Set this date to the begin of day, as interpreted in the UTC time zone.CalendarAwareDate
setUTCToBeginOfDayR()
Same assetUTCToBeginOfDay()
but returns this object.void
setUTCToEndOfDay()
Set this date to the end of day, as interpreted in the UTC time zone.CalendarAwareDate
setUTCToEndOfDayR()
Same assetUTCToEndOfDay()
but returns this object.void
setYear(int p_iValue)
Deprecated.void
subDays(int p_iDays)
Subtract from this date.void
subDays(int p_iDays, int p_iHours)
Subtract from this date.void
subDays(int p_iDays, int p_iHours, int p_iMinutes)
Subtract from this date.void
subDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
Subtract from this date.void
subDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Subtract from this date.CalendarAwareDate
subDaysR(int p_iDays)
Subtract from this date.CalendarAwareDate
subDaysR(int p_iDays, int p_iHours)
Subtract from this date.CalendarAwareDate
subDaysR(int p_iDays, int p_iHours, int p_iMinutes)
Subtract from this date.CalendarAwareDate
subDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
Subtract from this date.CalendarAwareDate
subDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Subtract from this date.void
subMilliseconds(long p_lMilliseconds)
Subtract the given number of milliseconds to the underlying value that represents this instance in time.CalendarAwareDate
subMillisecondsR(long p_lMillis)
Same assubMilliseconds(long)
but returns this object.void
subMonths(int p_iMonths)
Subtract from this date.CalendarAwareDate
subMonthsR(int p_iMonths)
Same assubMonths(int)
but returns this object.void
subUTCDays(int p_iDays)
Subtract from this date.void
subUTCDays(int p_iDays, int p_iHours)
Subtract from this date.void
subUTCDays(int p_iDays, int p_iHours, int p_iMinutes)
Subtract from this date.void
subUTCDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
Subtract from this date.void
subUTCDays(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Subtract from this date.CalendarAwareDate
subUTCDaysR(int p_iDays)
Subtract from this date.CalendarAwareDate
subUTCDaysR(int p_iDays, int p_iHours)
Subtract from this date.CalendarAwareDate
subUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes)
Subtract from this date.CalendarAwareDate
subUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds)
Subtract from this date.CalendarAwareDate
subUTCDaysR(int p_iDays, int p_iHours, int p_iMinutes, int p_iSeconds, int p_iMilliseconds)
Subtract from this date.void
subUTCMonths(int p_iMonths)
Subtract from this date.CalendarAwareDate
subUTCMonthsR(int p_iMonths)
Subtract from this date.void
subUTCYears(int p_iYears)
Subtract from this date.CalendarAwareDate
subUTCYearsR(int p_iYears)
Subtract from this date.void
subYears(int p_iYears)
Subtract from this date.CalendarAwareDate
subYearsR(int p_iYears)
Same asaddYears(int)
but returns this object.String
toJSON()
Return string that represents this date object jsonified.String
toUTCString()
Return a human-readable string that represents this date object, in UTC.ChimeraDate
unwrap()
CalendarAwareDate
withTimeZone(String p_strTimeZone)
Create a copy of this date object and associate a calendar with the given time zone with it.CalendarAwareDate
withTimeZone(TimeZone p_tz)
Create a copy of this date object and associate a calendar with the given time zone with it.-
Methods inherited from class java.sql.Timestamp
after, before, compareTo, compareTo, equals, equals, from, getNanos, getTime, hashCode, setNanos, setTime, toInstant, toLocalDateTime, toString, valueOf, valueOf
-
Methods inherited from class java.util.Date
after, before, getDate, getTimezoneOffset, parse, setDate, toGMTString, toLocaleString, UTC
-
-
-
-
Field Detail
-
SUNDAY
public static final int SUNDAY
1- See Also:
- Constant Field Values
-
MONDAY
public static final int MONDAY
2- See Also:
- Constant Field Values
-
TUESDAY
public static final int TUESDAY
3- See Also:
- Constant Field Values
-
WEDNESDAY
public static final int WEDNESDAY
4- See Also:
- Constant Field Values
-
THURSDAY
public static final int THURSDAY
5- See Also:
- Constant Field Values
-
FRIDAY
public static final int FRIDAY
6- See Also:
- Constant Field Values
-
SATURDAY
public static final int SATURDAY
7- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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.
-
-
Method Detail
-
clone
public CalendarAwareDate clone()
-
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.UsegetFullYear()
instead.Returns a value that is the result of subtracting1900
from the year, as interpreted in the given time zone.A call to this method is effectively equivalent with
getFullYear() - 1900
.
-
setYear
@Deprecated public void setYear(int p_iValue)
Deprecated.Set the year to the specified value plus1900
, as interpreted in the given time zone.
-
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 assetFullYear(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 assetFullYear(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 assetFullYear(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 assetUTCFullYear(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 assetUTCFullYear(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 assetUTCFullYear(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.
-
setMonth
public void setMonth(int p_iMonth)
Set the month, and day, as interpreted in the given time zone.
-
setMonthR
public CalendarAwareDate setMonthR(int p_iMonth)
Same assetMonth(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 assetMonth(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 assetUTCMonth(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 assetUTCMonthR(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.
-
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.
-
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.
-
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 assetDayOfMonth(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 assetUTCDayOfMonth(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 assetUTCDate(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.
-
setHours
public void setHours(int p_iHours)
Set the hour of day, as interpreted in the given time zone.
-
setHoursR
public CalendarAwareDate setHoursR(int p_iHours)
Same assetHours(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 assetHours(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 assetHours(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 assetHours(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 assetToBeginOfDay()
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 assetToEndOfDay()
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 assetToStartOfWeek(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 assetUTCHours(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 assetUTCHours(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 assetUTCHours(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 assetUTCHours(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 assetUTCToBeginOfDay()
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 assetUTCToEndOfDay()
but returns this object.- Returns:
- This object.
-
getMinutes
public int getMinutes()
Get the minute, as interpreted in the given time zone.- Overrides:
getMinutes
in classDate
- Returns:
- The minute.
-
setMinutes
public void setMinutes(int p_iMinutes)
Set the minute, as interpreted in the given time zone.- Overrides:
setMinutes
in classDate
- Parameters:
p_iMinutes
- The minutes.
-
setMinutesR
public CalendarAwareDate setMinutesR(int p_iMinutes)
Same assetMinutes(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 assetMinutes(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 assetMinutes(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 assetUTCMinutes(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 assetUTCMinutes(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 assetUTCMinutes(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 classDate
- Returns:
- The seconds.
-
setSeconds
public void setSeconds(int p_iSeconds)
Set the seconds, as interpreted in the given time zone.- Overrides:
setSeconds
in classDate
- Parameters:
p_iSeconds
- The seconds.
-
setSecondsR
public CalendarAwareDate setSecondsR(int p_iSeconds)
Same assetSeconds(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 assetSeconds(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 assetUTCSeconds(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 assetUTCSeconds(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 assetMilliseconds(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 assetUTCMilliseconds(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 asaddMilliseconds(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 assubMilliseconds(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 asaddYears(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 asaddYears(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 asaddMonths(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 assubMonths(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 thep_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
, andMILLISECOND
, 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 benull
or empty).- Throws:
IllegalArgumentException
- Ifp_strRules
isnull
or empty.
-
modifyR
public CalendarAwareDate modifyR(String p_strRules)
Same asmodify(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 thep_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
, andMILLISECOND
, 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 benull
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, orfalse
otherwise.- Throws:
IllegalArgumentException
- Ifp_strRules
isnull
or empty.
-
modifyR
public CalendarAwareDate modifyR(String p_strRules, boolean p_bClearMillis)
Same asmodify(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 thep_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
, andMILLISECOND
, 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 benull
or empty).- Throws:
IllegalArgumentException
- Ifp_strRules
isnull
or empty.
-
modifyUTCR
public CalendarAwareDate modifyUTCR(String p_strRules)
Same asmodifyUTC(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 thep_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
, andMILLISECOND
, 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 benull
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, orfalse
otherwise.- Throws:
IllegalArgumentException
- Ifp_strRules
isnull
or empty.
-
modifyUTCR
public CalendarAwareDate modifyUTCR(String p_strRules, boolean p_bClearMillis)
Same asmodifyUTC(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 interfaceIValueHolder<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 interfaceIValueHolder<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 interfaceIValueHolder<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 interfaceIValueHolder<Date>
- Returns:
true
if the data holder holds data, orfalse
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 interfaceIValueHolder<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()
-
-