Uses of Class
org.joda.time.Period
Packages that use Period
Package
Description
Provides support for dates, times, time zones, durations, intervals, and
partials.
Implementation package providing abstract and base time classes.
Provides printing and parsing support for instants and durations.
-
Uses of Period in org.joda.time
Fields in org.joda.time declared as PeriodModifier and TypeFieldDescriptionstatic final Period
Period.ZERO
A period of zero length and standard period type.Methods in org.joda.time that return PeriodModifier and TypeMethodDescriptionstatic Period
Period.days
(int days) Create a period with a specified number of days.static Period
Period.fieldDifference
(ReadablePartial start, ReadablePartial end) Creates a period from two partially specified times, calculating by field difference.static Period
Period.hours
(int hours) Create a period with a specified number of hours.static Period
Period.millis
(int millis) Create a period with a specified number of millis.Period.minus
(ReadablePeriod period) Returns a new period with the specified period subtracted.Period.minusDays
(int days) Returns a new period minus the specified number of days taken away.Period.minusHours
(int hours) Returns a new period minus the specified number of hours taken away.Period.minusMillis
(int millis) Returns a new period minus the specified number of millis taken away.Period.minusMinutes
(int minutes) Returns a new period minus the specified number of minutes taken away.Period.minusMonths
(int months) Returns a new period minus the specified number of months taken away.Period.minusSeconds
(int seconds) Returns a new period minus the specified number of seconds taken away.Period.minusWeeks
(int weeks) Returns a new period minus the specified number of weeks taken away.Period.minusYears
(int years) Returns a new period with the specified number of years taken away.static Period
Period.minutes
(int minutes) Create a period with a specified number of minutes.static Period
Period.months
(int months) Create a period with a specified number of months.Period.multipliedBy
(int scalar) Returns a new instance with each element in this period multiplied by the specified scalar.Period.negated()
Returns a new instance with each amount in this period negated.Period.normalizedStandard()
Normalizes this period using standard rules, assuming a 12 month year, 7 day week, 24 hour day, 60 minute hour and 60 second minute.Period.normalizedStandard
(PeriodType type) Normalizes this period using standard rules, assuming a 12 month year, 7 day week, 24 hour day, 60 minute hour and 60 second minute, providing control over how the result is split into fields.static Period
Parses aPeriod
from the specified string.static Period
Period.parse
(String str, PeriodFormatter formatter) Parses aPeriod
from the specified string using a formatter.Period.plus
(ReadablePeriod period) Returns a new period with the specified period added.Period.plusDays
(int days) Returns a new period plus the specified number of days added.Period.plusHours
(int hours) Returns a new period plus the specified number of hours added.Period.plusMillis
(int millis) Returns a new period plus the specified number of millis added.Period.plusMinutes
(int minutes) Returns a new period plus the specified number of minutes added.Period.plusMonths
(int months) Returns a new period plus the specified number of months added.Period.plusSeconds
(int seconds) Returns a new period plus the specified number of seconds added.Period.plusWeeks
(int weeks) Returns a new period plus the specified number of weeks added.Period.plusYears
(int years) Returns a new period with the specified number of years added.static Period
Period.seconds
(int seconds) Create a period with a specified number of seconds.Period.toPeriod()
Get this period as an immutablePeriod
object by returningthis
.ReadableDuration.toPeriod()
Converts this duration to a Period instance using the standard period type and the ISO chronology.ReadableInterval.toPeriod()
Converts the duration of the interval to a period using the standard period type.ReadableInterval.toPeriod
(PeriodType type) Converts the duration of the interval to a period using the specified period type.ReadablePeriod.toPeriod()
Get this period as an immutablePeriod
object.static Period
Period.weeks
(int weeks) Create a period with a specified number of weeks.Period.withDays
(int days) Returns a new period with the specified number of days.Period.withField
(DurationFieldType field, int value) Creates a new Period instance with the specified field set to a new value.Period.withFieldAdded
(DurationFieldType field, int value) Creates a new Period instance with the valueToAdd added to the specified field.Period.withFields
(ReadablePeriod period) Creates a new Period instance with the fields from the specified period copied on top of those from this period.Period.withHours
(int hours) Returns a new period with the specified number of hours.Period.withMillis
(int millis) Returns a new period with the specified number of millis.Period.withMinutes
(int minutes) Returns a new period with the specified number of minutes.Period.withMonths
(int months) Returns a new period with the specified number of months.Period.withPeriodType
(PeriodType type) Creates a new Period instance with the same field values but different PeriodType.Period.withSeconds
(int seconds) Returns a new period with the specified number of seconds.Period.withWeeks
(int weeks) Returns a new period with the specified number of weeks.Period.withYears
(int years) Returns a new period with the specified number of years.static Period
Period.years
(int years) Create a period with a specified number of years. -
Uses of Period in org.joda.time.base
Methods in org.joda.time.base that return PeriodModifier and TypeMethodDescriptionAbstractDuration.toPeriod()
Converts this duration to a Period instance using the standard period type and the ISO chronology.AbstractInterval.toPeriod()
Converts the duration of the interval to aPeriod
using the All period type.AbstractInterval.toPeriod
(PeriodType type) Converts the duration of the interval to aPeriod
using the specified period type.AbstractPeriod.toPeriod()
Get this period as an immutablePeriod
object.BaseDuration.toPeriod
(Chronology chrono) Converts this duration to a Period instance using the standard period type and the specified chronology.BaseDuration.toPeriod
(PeriodType type) Converts this duration to a Period instance using the specified period type and the ISO chronology.BaseDuration.toPeriod
(PeriodType type, Chronology chrono) Converts this duration to a Period instance using the specified period type and chronology.BaseSingleFieldPeriod.toPeriod()
Get this period as an immutablePeriod
object.BaseDuration.toPeriodFrom
(ReadableInstant startInstant) Converts this duration to a Period instance by adding the duration to a start instant to obtain an interval using the standard period type.BaseDuration.toPeriodFrom
(ReadableInstant startInstant, PeriodType type) Converts this duration to a Period instance by adding the duration to a start instant to obtain an interval.BaseDuration.toPeriodTo
(ReadableInstant endInstant) Converts this duration to a Period instance by subtracting the duration from an end instant to obtain an interval using the standard period type.BaseDuration.toPeriodTo
(ReadableInstant endInstant, PeriodType type) Converts this duration to a Period instance by subtracting the duration from an end instant to obtain an interval using the standard period type. -
Uses of Period in org.joda.time.format
Methods in org.joda.time.format that return PeriodModifier and TypeMethodDescriptionPeriodFormatter.parsePeriod
(String text) Parses a period from the given text, returning a new Period.