Uses of Class
org.joda.time.DateTime
Packages that use DateTime
Package
Description
Provides support for dates, times, time zones, durations, intervals, and
partials.
Implementation package providing abstract and base time classes.
Package containing the chronology classes which define the calendar systems.
Provides printing and parsing support for instants and durations.
-
Uses of DateTime in org.joda.time
Methods in org.joda.time that return DateTimeModifier and TypeMethodDescriptionDateTime.Property.addToCopy
(int value) Adds to this field in a copy of this DateTime.DateTime.Property.addToCopy
(long value) Adds to this field in a copy of this DateTime.DateTime.Property.addWrapFieldToCopy
(int value) Adds to this field, possibly wrapped, in a copy of this DateTime.DateTime.Property.getDateTime()
Gets the datetime being used.ReadableInterval.getEnd()
Gets the end of this time interval, which is exclusive, as a DateTime.ReadableInterval.getStart()
Gets the start of this time interval, which is inclusive, as a DateTime.DateTime.minus
(long duration) Returns a copy of this datetime with the specified duration taken away.DateTime.minus
(ReadableDuration duration) Returns a copy of this datetime with the specified duration taken away.DateTime.minus
(ReadablePeriod period) Returns a copy of this datetime with the specified period taken away.DateTime.minusDays
(int days) Returns a copy of this datetime minus the specified number of days.DateTime.minusHours
(int hours) Returns a copy of this datetime minus the specified number of hours.DateTime.minusMillis
(int millis) Returns a copy of this datetime minus the specified number of millis.DateTime.minusMinutes
(int minutes) Returns a copy of this datetime minus the specified number of minutes.DateTime.minusMonths
(int months) Returns a copy of this datetime minus the specified number of months.DateTime.minusSeconds
(int seconds) Returns a copy of this datetime minus the specified number of seconds.DateTime.minusWeeks
(int weeks) Returns a copy of this datetime minus the specified number of weeks.DateTime.minusYears
(int years) Returns a copy of this datetime minus the specified number of years.static DateTime
DateTime.now()
Obtains aDateTime
set to the current system millisecond time usingISOChronology
in the default time zone.static DateTime
DateTime.now
(Chronology chronology) Obtains aDateTime
set to the current system millisecond time using the specified chronology.static DateTime
DateTime.now
(DateTimeZone zone) Obtains aDateTime
set to the current system millisecond time usingISOChronology
in the specified time zone.static DateTime
Parses aDateTime
from the specified string.static DateTime
DateTime.parse
(String str, DateTimeFormatter formatter) Parses aDateTime
from the specified string using a formatter.DateTime.plus
(long duration) Returns a copy of this datetime with the specified duration added.DateTime.plus
(ReadableDuration duration) Returns a copy of this datetime with the specified duration added.DateTime.plus
(ReadablePeriod period) Returns a copy of this datetime with the specified period added.DateTime.plusDays
(int days) Returns a copy of this datetime plus the specified number of days.DateTime.plusHours
(int hours) Returns a copy of this datetime plus the specified number of hours.DateTime.plusMillis
(int millis) Returns a copy of this datetime plus the specified number of millis.DateTime.plusMinutes
(int minutes) Returns a copy of this datetime plus the specified number of minutes.DateTime.plusMonths
(int months) Returns a copy of this datetime plus the specified number of months.DateTime.plusSeconds
(int seconds) Returns a copy of this datetime plus the specified number of seconds.DateTime.plusWeeks
(int weeks) Returns a copy of this datetime plus the specified number of weeks.DateTime.plusYears
(int years) Returns a copy of this datetime plus the specified number of years.DateTime.Property.roundCeilingCopy()
Rounds to the highest whole unit of this field on a copy of this DateTime.DateTime.Property.roundFloorCopy()
Rounds to the lowest whole unit of this field on a copy of this DateTime.DateTime.Property.roundHalfCeilingCopy()
Rounds to the nearest whole unit of this field on a copy of this DateTime, favoring the ceiling if halfway.DateTime.Property.roundHalfEvenCopy()
Rounds to the nearest whole unit of this field on a copy of this DateTime.DateTime.Property.roundHalfFloorCopy()
Rounds to the nearest whole unit of this field on a copy of this DateTime, favoring the floor if halfway.DateTime.Property.setCopy
(int value) Sets this field in a copy of the DateTime.Sets this field in a copy of the DateTime to a parsed text value.Sets this field in a copy of the DateTime to a parsed text value.DateTime.toDateTime()
Get this object as a DateTime by returningthis
.DateTime.toDateTime
(Chronology chronology) Get this object as a DateTime, returningthis
if possible.DateTime.toDateTime
(DateTimeZone zone) Get this object as a DateTime, returningthis
if possible.Instant.toDateTime()
Get this object as a DateTime using ISOChronology in the default zone.LocalDate.toDateTime
(LocalTime time) Converts this object to a DateTime using a LocalTime to fill in the missing fields and using the default time zone.LocalDate.toDateTime
(LocalTime time, DateTimeZone zone) Converts this object to a DateTime using a LocalTime to fill in the missing fields.LocalDateTime.toDateTime()
Converts this object to a DateTime using the default zone.LocalDateTime.toDateTime
(DateTimeZone zone) Converts this object to a DateTime using the specified zone.ReadableDateTime.toDateTime()
Get this object as a DateTime.ReadablePartial.toDateTime
(ReadableInstant baseInstant) Converts this partial to a full datetime by resolving it against another datetime.YearMonthDay.toDateTime
(TimeOfDay time) Deprecated.Converts this object to a DateTime using a TimeOfDay to fill in the missing fields and using the default time zone.YearMonthDay.toDateTime
(TimeOfDay time, DateTimeZone zone) Deprecated.Converts this object to a DateTime using a TimeOfDay to fill in the missing fields.LocalDate.toDateTimeAtCurrentTime()
Converts this LocalDate to a full datetime using the default time zone setting the date fields from this instance and the time fields from the current time.LocalDate.toDateTimeAtCurrentTime
(DateTimeZone zone) Converts this LocalDate to a full datetime using the specified time zone setting the date fields from this instance and the time fields from the current time.YearMonthDay.toDateTimeAtCurrentTime()
Deprecated.Converts this partial to a full datetime using the default time zone setting the date fields from this instance and the time fields from the current time.YearMonthDay.toDateTimeAtCurrentTime
(DateTimeZone zone) Deprecated.Converts this partial to a full datetime using the specified time zone setting the date fields from this instance and the time fields from the current time.LocalDate.toDateTimeAtMidnight()
Deprecated.LocalDate.toDateTimeAtMidnight
(DateTimeZone zone) Deprecated.UseLocalDate.toDateTimeAtStartOfDay(DateTimeZone)
which won't throw an exceptionYearMonthDay.toDateTimeAtMidnight()
Deprecated.Converts this YearMonthDay to a full datetime at midnight using the default time zone.YearMonthDay.toDateTimeAtMidnight
(DateTimeZone zone) Deprecated.Converts this YearMonthDay to a full datetime at midnight using the specified time zone.LocalDate.toDateTimeAtStartOfDay()
Converts this LocalDate to a full datetime at the earliest valid time for the date using the default time zone.LocalDate.toDateTimeAtStartOfDay
(DateTimeZone zone) Converts this LocalDate to a full datetime at the earliest valid time for the date using the specified time zone.DateTime.toDateTimeISO()
Get this object as a DateTime using ISOChronology in the default zone, returningthis
if possible.Instant.toDateTimeISO()
Deprecated.Use toDateTime() as it is identicalLocalTime.toDateTimeToday()
Converts this LocalTime to a full datetime using the default time zone setting the time fields from this instance and the date fields from the current date.LocalTime.toDateTimeToday
(DateTimeZone zone) Converts this LocalTime to a full datetime using the specified time zone setting the time fields from this instance and the date fields from the current time.TimeOfDay.toDateTimeToday()
Deprecated.Converts this partial to a full datetime using the default time zone setting the time fields from this instance and the date fields from the current time.TimeOfDay.toDateTimeToday
(DateTimeZone zone) Deprecated.Converts this partial to a full datetime using the specified time zone setting the time fields from this instance and the date fields from the current time.DateTime.withCenturyOfEra
(int centuryOfEra) Returns a copy of this datetime with the century of era field updated.DateTime.withChronology
(Chronology newChronology) Returns a copy of this datetime with a different chronology.DateTime.withDate
(int year, int monthOfYear, int dayOfMonth) Returns a copy of this datetime with the specified date, retaining the time fields.Returns a copy of this datetime with the specified date, retaining the time fields.DateTime.withDayOfMonth
(int dayOfMonth) Returns a copy of this datetime with the day of month field updated.DateTime.withDayOfWeek
(int dayOfWeek) Returns a copy of this datetime with the day of week field updated.DateTime.withDayOfYear
(int dayOfYear) Returns a copy of this datetime with the day of year field updated.DateTime.withDurationAdded
(long durationToAdd, int scalar) Returns a copy of this datetime with the specified duration added.DateTime.withDurationAdded
(ReadableDuration durationToAdd, int scalar) Returns a copy of this datetime with the specified duration added.DateTime.withEarlierOffsetAtOverlap()
Returns a copy of this ZonedDateTime changing the zone offset to the earlier of the two valid offsets at a local time-line overlap.DateTime.withEra
(int era) Returns a copy of this datetime with the era field updated.DateTime.withField
(DateTimeFieldType fieldType, int value) Returns a copy of this datetime with the specified field set to a new value.DateTime.withFieldAdded
(DurationFieldType fieldType, int amount) Returns a copy of this datetime with the value of the specified field increased.DateTime.withFields
(ReadablePartial partial) Returns a copy of this datetime with the partial set of fields replacing those from this instance.DateTime.withHourOfDay
(int hour) Returns a copy of this datetime with the hour of day field updated.DateTime.withLaterOffsetAtOverlap()
Returns a copy of this ZonedDateTime changing the zone offset to the later of the two valid offsets at a local time-line overlap.DateTime.Property.withMaximumValue()
Returns a new DateTime with this field set to the maximum value for this field.DateTime.withMillis
(long newMillis) Returns a copy of this datetime with different millis.DateTime.withMillisOfDay
(int millis) Returns a copy of this datetime with the millis of day field updated.DateTime.withMillisOfSecond
(int millis) Returns a copy of this datetime with the millis of second field updated.DateTime.Property.withMinimumValue()
Returns a new DateTime with this field set to the minimum value for this field.DateTime.withMinuteOfHour
(int minute) Returns a copy of this datetime with the minute of hour updated.DateTime.withMonthOfYear
(int monthOfYear) Returns a copy of this datetime with the month of year field updated.DateTime.withPeriodAdded
(ReadablePeriod period, int scalar) Returns a copy of this datetime with the specified period added.DateTime.withSecondOfMinute
(int second) Returns a copy of this datetime with the second of minute field updated.DateTime.withTime
(int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) Returns a copy of this datetime with the specified time, retaining the date fields.Returns a copy of this datetime with the specified time, retaining the date fields.DateTime.withTimeAtStartOfDay()
Returns a copy of this datetime with the time set to the start of the day.DateTime.withWeekOfWeekyear
(int weekOfWeekyear) Returns a copy of this datetime with the week of weekyear field updated.DateTime.withWeekyear
(int weekyear) Returns a copy of this datetime with the weekyear field updated.DateTime.withYear
(int year) Returns a copy of this datetime with the year field updated.DateTime.withYearOfCentury
(int yearOfCentury) Returns a copy of this datetime with the year of century field updated.DateTime.withYearOfEra
(int yearOfEra) Returns a copy of this datetime with the year of era field updated.DateTime.withZone
(DateTimeZone newZone) Returns a copy of this datetime with a different time zone, preserving the millisecond instant.DateTime.withZoneRetainFields
(DateTimeZone newZone) Returns a copy of this datetime with a different time zone, preserving the field values. -
Uses of DateTime in org.joda.time.base
Methods in org.joda.time.base that return DateTimeModifier and TypeMethodDescriptionAbstractInterval.getEnd()
Gets the end of this time interval, which is exclusive, as a DateTime.AbstractInterval.getStart()
Gets the start of this time interval, which is inclusive, as a DateTime.AbstractInstant.toDateTime()
Get this object as a DateTime in the same zone.AbstractInstant.toDateTime
(Chronology chronology) Get this object as a DateTime using the given chronology and its zone.AbstractInstant.toDateTime
(DateTimeZone zone) Get this object as a DateTime using the same chronology but a different zone.AbstractPartial.toDateTime
(ReadableInstant baseInstant) Resolves this partial against another complete instant to create a new full instant.AbstractInstant.toDateTimeISO()
Get this object as a DateTime using ISOChronology in the same zone. -
Uses of DateTime in org.joda.time.chrono
Methods in org.joda.time.chrono that return DateTimeModifier and TypeMethodDescriptionLimitChronology.getLowerLimit()
Returns the inclusive lower limit instant.LimitChronology.getUpperLimit()
Returns the inclusive upper limit instant. -
Uses of DateTime in org.joda.time.format
Methods in org.joda.time.format that return DateTimeModifier and TypeMethodDescriptionDateTimeFormatter.parseDateTime
(String text) Parses a date-time from the given text, returning a new DateTime.
LocalDate.toDateTimeAtStartOfDay()
which won't throw an exception