public final class GregorianDateTime extends GregorianCalendar
Calendar.BuilderAD, BCALL_STYLES, AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, LONG, LONG_FORMAT, LONG_STANDALONE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NARROW_FORMAT, NARROW_STANDALONE, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SHORT, SHORT_FORMAT, SHORT_STANDALONE, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET| Constructor and Description |
|---|
GregorianDateTime()
Default constructor.
|
GregorianDateTime(Calendar calendar)
Creates a new Gregorian date from a given
java.util.Calendar. |
GregorianDateTime(Date date)
Creates a new Gregorian date from a given
java.util.Date. |
GregorianDateTime(Date date,
TimeZone zone)
Creates a new Gregorian date from a given
java.util.Date. |
GregorianDateTime(int year,
int month,
int day)
Creates a new Gregorian date from given year, month and date.
|
GregorianDateTime(int year,
int month,
int day,
int hour,
int minute,
int second)
Creates a new Gregorian date from given year, month and date.
|
GregorianDateTime(int year,
int month,
int day,
int hour,
int minute,
int second,
TimeZone zone)
Creates a new Gregorian date from given year, month and date.
|
GregorianDateTime(TimeZone zone)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
computeTime()
Overwrites GregorianCalendar.computeTime(), to disable all time fields.
|
int |
getDay()
Returns the day of the calendar.
|
int |
getHour()
Returns the hour of the calendar.
|
int |
getMinute()
Returns the minute of the calendar.
|
int |
getMonth()
Returns the month of the calendar.
|
int |
getSecond()
Returns the second of the calendar.
|
int |
getYear()
Returns the year of the calendar.
|
void |
set(int field,
int value)
Overwrite prevents setting time fields.
|
void |
setTimeZone(TimeZone zone)
Overwrite prevents setting a time zone to keep the time unchanged and unavailable.
|
String |
toString() |
add, clone, computeFields, equals, from, getActualMaximum, getActualMinimum, getCalendarType, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, getTimeZone, getWeeksInWeekYear, getWeekYear, hashCode, isLeapYear, isWeekDateSupported, roll, roll, setGregorianChange, setWeekDate, toZonedDateTimeafter, before, clear, clear, compareTo, complete, get, getAvailableCalendarTypes, getAvailableLocales, getDisplayName, getDisplayNames, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, internalGet, isLenient, isSet, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, toInstantpublic GregorianDateTime()
public GregorianDateTime(TimeZone zone)
zone - the given time zone.public GregorianDateTime(Date date)
java.util.Date.date - the date for the new calendarpublic GregorianDateTime(Date date, TimeZone zone)
java.util.Date.date - the date for the new calendarzone - the given time zone.public GregorianDateTime(Calendar calendar)
java.util.Calendar.calendar - the original calendar for the new calendarpublic GregorianDateTime(int year,
int month,
int day)
The first month of the year is JANUARY which is 0; the
last month is DEDCEMBER which is 11.
year - the year of the new calendarmonth - the month of the new calendarday - the day of the new calendarpublic GregorianDateTime(int year,
int month,
int day,
int hour,
int minute,
int second)
The first month of the year is JANUARY which is 0; the
last month is DEDCEMBER which is 11.
year - the year of the new calendarmonth - the month of the new calendarday - the day of the new calendarhour - the hour of the new calendarminute - the minute of the new calendarsecond - the second of the new calendarpublic GregorianDateTime(int year,
int month,
int day,
int hour,
int minute,
int second,
TimeZone zone)
The first month of the year is JANUARY which is 0; the
last month is DEDCEMBER which is 11.
year - the year of the new calendarmonth - the month of the new calendarday - the day of the new calendarhour - the hour of the new calendarminute - the minute of the new calendarsecond - the second of the new calendarzone - the given time zone.public void set(int field,
int value)
set in class Calendarfield - the given calendar field.value - the value to be set for the given calendar field.Calendar.set(int, int)public void setTimeZone(TimeZone zone)
setTimeZone in class GregorianCalendarzone - the new time zone (ignored)Calendar.setTimeZone(java.util.TimeZone)protected void computeTime()
computeTime in class GregorianCalendarCalendar.computeTime()public int getMonth()
public int getDay()
public int getYear()
public int getHour()
public int getMinute()
public int getSecond()
public String toString()
toString in class CalendarCalendar.toString()Copyright © 2005–2020. All rights reserved.