Java org.joda.time DateTime fields, constructors, methods, implement or subclass

Example usage for Java org.joda.time DateTime fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.joda.time DateTime.

The text is from its open source code.

Constructor

DateTime()
Constructs an instance set to the current system millisecond time using ISOChronology in the default time zone.
DateTime(DateTimeZone zone)
Constructs an instance set to the current system millisecond time using ISOChronology in the specified time zone.
DateTime(Chronology chronology)
Constructs an instance set to the current system millisecond time using the specified chronology.
DateTime(long instant)
Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z using ISOChronology in the default time zone.
DateTime(Object instant)
Constructs an instance from an Object that represents a datetime.
DateTime(long instant, DateTimeZone zone)
Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z using ISOChronology in the specified time zone.
DateTime(long instant, Chronology chronology)
Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z using the specified chronology.
DateTime(Object instant, DateTimeZone zone)
Constructs an instance from an Object that represents a datetime, forcing the time zone to that specified.
DateTime(Object instant, Chronology chronology)
Constructs an instance from an Object that represents a datetime, using the specified chronology.
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, DateTimeZone zone)
Constructs an instance from datetime field values using ISOChronology in the specified time zone.
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, Chronology chronology)
Constructs an instance from datetime field values using the specified chronology.
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)
Constructs an instance from datetime field values using ISOChronology in the default time zone.
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, DateTimeZone zone)
Constructs an instance from datetime field values using ISOChronology in the specified time zone.
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, Chronology chronology)
Constructs an instance from datetime field values using the specified chronology.
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute)
Constructs an instance from datetime field values using ISOChronology in the default time zone.
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, DateTimeZone zone)
Constructs an instance from datetime field values using ISOChronology in the specified time zone.
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, Chronology chronology)
Constructs an instance from datetime field values using the specified chronology.
DateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
Constructs an instance from datetime field values using ISOChronology in the default time zone.

Method

PropertycenturyOfEra()
Get the century of era property which provides access to advanced functionality.
PropertydayOfMonth()
Get the day of month property which provides access to advanced functionality.
PropertydayOfWeek()
Get the day of week property which provides access to advanced functionality.
PropertydayOfYear()
Get the day of year property which provides access to advanced functionality.
intget(DateTimeFieldType type)
Get the value of one of the fields of a datetime.
intgetCenturyOfEra()
Get the year of era field value.
ChronologygetChronology()
Gets the chronology of the datetime.
intgetDayOfMonth()
Get the day of month field value.
intgetDayOfWeek()
Get the day of week field value.
intgetDayOfYear()
Get the day of year field value.
intgetEra()
Get the era field value.
intgetHourOfDay()
Get the hour of day field value.
longgetMillis()
Gets the milliseconds of the datetime instant from the Java epoch of 1970-01-01T00:00:00Z.
intgetMillisOfDay()
Get the millis of day field value.
intgetMillisOfSecond()
Get the millis of second field value.
intgetMinuteOfDay()
Get the minute of day field value.
intgetMinuteOfHour()
Get the minute of hour field value.
intgetMonthOfYear()
Get the month of year field value.
intgetSecondOfDay()
Get the second of day field value.
intgetSecondOfMinute()
Get the second of minute field value.
intgetWeekOfWeekyear()
Get the week of weekyear field value.
intgetWeekyear()
Get the weekyear field value.
intgetYear()
Get the year field value.
intgetYearOfCentury()
Get the year of century field value.
intgetYearOfEra()
Get the year of era field value.
PropertyhourOfDay()
Get the hour of day field property which provides access to advanced functionality.
PropertymillisOfDay()
Get the millis of day property which provides access to advanced functionality.
PropertymillisOfSecond()
Get the millis of second property which provides access to advanced functionality.
DateTimeminus(long duration)
Returns a copy of this datetime with the specified duration taken away.
DateTimeminus(ReadableDuration duration)
Returns a copy of this datetime with the specified duration taken away.
DateTimeminus(ReadablePeriod period)
Returns a copy of this datetime with the specified period taken away.
DateTimeminusDays(int days)
Returns a copy of this datetime minus the specified number of days.
DateTimeminusHours(int hours)
Returns a copy of this datetime minus the specified number of hours.
DateTimeminusMillis(int millis)
Returns a copy of this datetime minus the specified number of millis.
DateTimeminusMinutes(int minutes)
Returns a copy of this datetime minus the specified number of minutes.
DateTimeminusMonths(int months)
Returns a copy of this datetime minus the specified number of months.
DateTimeminusSeconds(int seconds)
Returns a copy of this datetime minus the specified number of seconds.
DateTimeminusWeeks(int weeks)
Returns a copy of this datetime minus the specified number of weeks.
DateTimeminusYears(int years)
Returns a copy of this datetime minus the specified number of years.
PropertyminuteOfDay()
Get the minute of day property which provides access to advanced functionality.
PropertyminuteOfHour()
Get the minute of hour field property which provides access to advanced functionality.
PropertymonthOfYear()
Get the month of year property which provides access to advanced functionality.
DateTimenow()
Obtains a DateTime set to the current system millisecond time using ISOChronology in the default time zone.
DateTimenow(DateTimeZone zone)
Obtains a DateTime set to the current system millisecond time using ISOChronology in the specified time zone.
DateTimenow(Chronology chronology)
Obtains a DateTime set to the current system millisecond time using the specified chronology.
DateTimeparse(String str, DateTimeFormatter formatter)
Parses a DateTime from the specified string using a formatter.
DateTimeparse(String str)
Parses a DateTime from the specified string.
DateTimeplus(long duration)
Returns a copy of this datetime with the specified duration added.
DateTimeplus(ReadableDuration duration)
Returns a copy of this datetime with the specified duration added.
DateTimeplus(ReadablePeriod period)
Returns a copy of this datetime with the specified period added.
DateTimeplusDays(int days)
Returns a copy of this datetime plus the specified number of days.
DateTimeplusHours(int hours)
Returns a copy of this datetime plus the specified number of hours.
DateTimeplusMillis(int millis)
Returns a copy of this datetime plus the specified number of millis.
DateTimeplusMinutes(int minutes)
Returns a copy of this datetime plus the specified number of minutes.
DateTimeplusMonths(int months)
Returns a copy of this datetime plus the specified number of months.
DateTimeplusSeconds(int seconds)
Returns a copy of this datetime plus the specified number of seconds.
DateTimeplusWeeks(int weeks)
Returns a copy of this datetime plus the specified number of weeks.
DateTimeplusYears(int years)
Returns a copy of this datetime plus the specified number of years.
Propertyproperty(DateTimeFieldType type)
Gets the property object for the specified type, which contains many useful methods.
PropertysecondOfDay()
Get the second of day property which provides access to advanced functionality.
PropertysecondOfMinute()
Get the second of minute field property which provides access to advanced functionality.
CalendartoCalendar(Locale locale)
Get the date time as a java.util.Calendar, assigning exactly the same millisecond instant.
DateMidnighttoDateMidnight()
Converts this object to a DateMidnight using the same millis and chronology.
DateTimetoDateTime()
Get this object as a DateTime by returning this.
DateTimetoDateTime(DateTimeZone zone)
Get this object as a DateTime, returning this if possible.
DateTimetoDateTime(Chronology chronology)
Get this object as a DateTime, returning this if possible.
DateTimetoDateTimeISO()
Get this object as a DateTime using ISOChronology in the default zone, returning this if possible.
GregorianCalendartoGregorianCalendar()
Get the date time as a java.util.GregorianCalendar, assigning exactly the same millisecond instant.
LocalDatetoLocalDate()
Converts this object to a LocalDate with the same date and chronology.
LocalDateTimetoLocalDateTime()
Converts this object to a LocalDateTime with the same datetime and chronology.
LocalTimetoLocalTime()
Converts this object to a LocalTime with the same time and chronology.
MutableDateTimetoMutableDateTime()
Get this object as a MutableDateTime, always returning a new instance.
StringtoString(String pattern)
Output the instant using the specified format pattern.
StringtoString()
Output the date time in ISO8601 format (yyyy-MM-ddTHH:mm:ss.SSSZZ).
StringtoString(String pattern, Locale locale)
Output the instant using the specified format pattern.
YearMonthDaytoYearMonthDay()
Converts this object to a YearMonthDay using the same millis and chronology.
PropertyweekOfWeekyear()
Get the week of a week based year property which provides access to advanced functionality.
Propertyweekyear()
Get the year of a week based year property which provides access to advanced functionality.
DateTimewithCenturyOfEra(int centuryOfEra)
Returns a copy of this datetime with the century of era field updated.
DateTimewithChronology(Chronology newChronology)
Returns a copy of this datetime with a different chronology.
DateTimewithDate(int year, int monthOfYear, int dayOfMonth)
Returns a copy of this datetime with the specified date, retaining the time fields.
DateTimewithDate(LocalDate date)
Returns a copy of this datetime with the specified date, retaining the time fields.
DateTimewithDayOfMonth(int dayOfMonth)
Returns a copy of this datetime with the day of month field updated.
DateTimewithDayOfWeek(int dayOfWeek)
Returns a copy of this datetime with the day of week field updated.
DateTimewithDayOfYear(int dayOfYear)
Returns a copy of this datetime with the day of year field updated.
DateTimewithEarlierOffsetAtOverlap()
Returns a copy of this ZonedDateTime changing the zone offset to the earlier of the two valid offsets at a local time-line overlap.
DateTimewithField(DateTimeFieldType fieldType, int value)
Returns a copy of this datetime with the specified field set to a new value.
DateTimewithFieldAdded(DurationFieldType fieldType, int amount)
Returns a copy of this datetime with the value of the specified field increased.
DateTimewithFields(ReadablePartial partial)
Returns a copy of this datetime with the partial set of fields replacing those from this instance.
DateTimewithHourOfDay(int hour)
Returns a copy of this datetime with the hour of day field updated.
DateTimewithLaterOffsetAtOverlap()
Returns a copy of this ZonedDateTime changing the zone offset to the later of the two valid offsets at a local time-line overlap.
DateTimewithMillis(long newMillis)
Returns a copy of this datetime with different millis.
DateTimewithMillisOfDay(int millis)
Returns a copy of this datetime with the millis of day field updated.
DateTimewithMillisOfSecond(int millis)
Returns a copy of this datetime with the millis of second field updated.
DateTimewithMinuteOfHour(int minute)
Returns a copy of this datetime with the minute of hour updated.
DateTimewithMonthOfYear(int monthOfYear)
Returns a copy of this datetime with the month of year field updated.
DateTimewithPeriodAdded(ReadablePeriod period, int scalar)
Returns a copy of this datetime with the specified period added.
DateTimewithSecondOfMinute(int second)
Returns a copy of this datetime with the second of minute field updated.
DateTimewithTime(int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)
Returns a copy of this datetime with the specified time, retaining the date fields.
DateTimewithTime(LocalTime time)
Returns a copy of this datetime with the specified time, retaining the date fields.
DateTimewithTimeAtStartOfDay()
Returns a copy of this datetime with the time set to the start of the day.
DateTimewithWeekOfWeekyear(int weekOfWeekyear)
Returns a copy of this datetime with the week of weekyear field updated.
DateTimewithYear(int year)
Returns a copy of this datetime with the year field updated.
DateTimewithZone(DateTimeZone newZone)
Returns a copy of this datetime with a different time zone, preserving the millisecond instant.
DateTimewithZoneRetainFields(DateTimeZone newZone)
Returns a copy of this datetime with a different time zone, preserving the field values.
Propertyyear()
Get the year property which provides access to advanced functionality.
PropertyyearOfCentury()
Get the year of century property which provides access to advanced functionality.
PropertyyearOfEra()
Get the year of era property which provides access to advanced functionality.