Defines an instant in time that can be queried and modified using datetime fields.
The implementation of this interface will be mutable.
It may provide more advanced methods than those in the interface.
Methods in your application should be defined using
ReadWritableDateTime
as a parameter if the method wants to manipulate and change a date in simple ways.
addDays
public void addDays(int days)
Add a number of days to the date.
addHours
public void addHours(int hours)
Add a number of hours to the date.
addMillis
public void addMillis(int millis)
Add a number of milliseconds to the date. The implementation of this
method differs from the add(long)
method in that a
DateTimeField performs the addition.
millis
- the milliseconds to add
addMinutes
public void addMinutes(int minutes)
Add a number of minutes to the date.
minutes
- the minutes to add
addMonths
public void addMonths(int months)
Add a number of months to the date.
months
- the months to add
addSeconds
public void addSeconds(int seconds)
Add a number of seconds to the date.
seconds
- the seconds to add
addWeeks
public void addWeeks(int weeks)
Add a number of weeks to the date.
addWeekyears
public void addWeekyears(int weekyears)
Add a number of weekyears to the date.
weekyears
- the weekyears to add
addYears
public void addYears(int years)
Add a number of years to the date.
setDate
public void setDate(int year,
int monthOfYear,
int dayOfMonth)
Set the date from fields.
The time part of this object will be unaffected.
year
- the yearmonthOfYear
- the month of the yeardayOfMonth
- the day of the month
setDateTime
public void setDateTime(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int millisOfSecond)
Set the date and time from fields.
year
- the yearmonthOfYear
- the month of the yeardayOfMonth
- the day of the monthhourOfDay
- the hour of the dayminuteOfHour
- the minute of the hoursecondOfMinute
- the second of the minutemillisOfSecond
- the millisecond of the second
setDayOfMonth
public void setDayOfMonth(int dayOfMonth)
Set the day of the month to the specified value.
dayOfMonth
- the day of the month
setDayOfWeek
public void setDayOfWeek(int dayOfWeek)
Set the day of week to the specified value.
dayOfWeek
- the day of the week
setDayOfYear
public void setDayOfYear(int dayOfYear)
Set the day of year to the specified value.
dayOfYear
- the day of the year
setHourOfDay
public void setHourOfDay(int hourOfDay)
Set the hour of the day to the specified value.
hourOfDay
- the hour of day
setMillisOfDay
public void setMillisOfDay(int millisOfDay)
Set the millis of the day to the specified value.
millisOfDay
- the millis of day
setMillisOfSecond
public void setMillisOfSecond(int millisOfSecond)
Set the millis of the second to the specified value.
millisOfSecond
- the millis of second
setMinuteOfDay
public void setMinuteOfDay(int minuteOfDay)
Set the minute of the day to the specified value.
minuteOfDay
- the minute of day
setMinuteOfHour
public void setMinuteOfHour(int minuteOfHour)
Set the minute of the hour to the specified value.
minuteOfHour
- the minute of hour
setMonthOfYear
public void setMonthOfYear(int monthOfYear)
Set the month of the year to the specified value.
monthOfYear
- the month of the year
setSecondOfDay
public void setSecondOfDay(int secondOfDay)
Set the second of the day to the specified value.
secondOfDay
- the second of day
setSecondOfMinute
public void setSecondOfMinute(int secondOfMinute)
Set the second of the minute to the specified value.
secondOfMinute
- the second of minute
setTime
public void setTime(int hour,
int minuteOfHour,
int secondOfMinute,
int millisOfSecond)
Set the time from fields.
The date part of this object will be unaffected.
hour
- the hourminuteOfHour
- the minute of the hoursecondOfMinute
- the second of the minutemillisOfSecond
- the millisecond of the second
setWeekOfWeekyear
public void setWeekOfWeekyear(int weekOfWeekyear)
Set the week of weekyear to the specified value.
weekOfWeekyear
- the week of the weekyear
setWeekyear
public void setWeekyear(int weekyear)
Set the weekyear to the specified value.
setYear
public void setYear(int year)
Set the year to the specified value.