Period Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A date-based amount of time in the ISO-8601 calendar system, such as '2 years, 3 months and 4 days'.
[Android.Runtime.Register("java/time/Period", ApiSince=26, DoNotGenerateAcw=true)]
public sealed class Period : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ISerializable, Java.Time.Chrono.IChronoPeriod
[<Android.Runtime.Register("java/time/Period", ApiSince=26, DoNotGenerateAcw=true)>]
type Period = class
inherit Object
interface ISerializable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
interface IChronoPeriod
interface ITemporalAmount
- Inheritance
- Attributes
- Implements
Remarks
A date-based amount of time in the ISO-8601 calendar system, such as '2 years, 3 months and 4 days'.
This class models a quantity or amount of time in terms of years, months and days. See Duration
for the time-based equivalent to this class.
Durations and periods differ in their treatment of daylight savings time when added to ZonedDateTime
. A Duration
will add an exact number of seconds, thus a duration of one day is always exactly 24 hours. By contrast, a Period
will add a conceptual day, trying to maintain the local time.
For example, consider adding a period of one day and a duration of one day to 18:00 on the evening before a daylight savings gap. The Period
will add the conceptual day and result in a ZonedDateTime
at 18:00 the following day. By contrast, the Duration
will add exactly 24 hours, resulting in a ZonedDateTime
at 19:00 the following day (assuming a one hour DST gap).
The supported units of a period are ChronoUnit#YEARS YEARS
, ChronoUnit#MONTHS MONTHS
and ChronoUnit#DAYS DAYS
. All three fields are always present, but may be set to zero.
The ISO-8601 calendar system is the modern civil calendar system used today in most of the world. It is equivalent to the proleptic Gregorian calendar system, in which today's rules for leap years are applied for all time.
The period is modeled as a directed amount of time, meaning that individual parts of the period may be negative.
Added in 1.8.
Java documentation for java.time.Period
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Properties
Chronology | |
Class |
Returns the runtime class of this |
Days |
Gets the amount of days of this period. |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
IsNegative |
Checks if any of the three units of this period are negative. |
IsZero |
Checks if all three units of this period are zero. |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
Months |
Gets the amount of months of this period. |
PeerReference | (Inherited from Object) |
ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Object) |
ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Object) |
Units | |
Years |
Gets the amount of years of this period. |
Zero |
Methods
AddTo(ITemporal) | |
Between(LocalDate, LocalDate) | |
Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
From(ITemporalAmount) | |
Get(ITemporalUnit) | |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
Minus(ITemporalAmount) | |
MinusDays(Int64) | |
MinusMonths(Int64) | |
MinusYears(Int64) | |
MultipliedBy(Int32) | |
Negated() | |
Normalized() | |
Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
Of(Int32, Int32, Int32) | |
OfDays(Int32) | |
OfMonths(Int32) | |
OfWeeks(Int32) | |
OfYears(Int32) | |
Parse(ICharSequence) | |
Parse(String) | |
Plus(ITemporalAmount) | |
PlusDays(Int64) | |
PlusMonths(Int64) | |
PlusYears(Int64) | |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
SubtractFrom(ITemporal) | |
ToArray<T>() | (Inherited from Object) |
ToString() |
Returns a string representation of the object. (Inherited from Object) |
ToTotalMonths() |
Gets the total number of months in this period. |
UnregisterFromRuntime() | (Inherited from Object) |
Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
WithDays(Int32) | |
WithMonths(Int32) | |
WithYears(Int32) |
Explicit Interface Implementations
IJavaPeerable.Disposed() | (Inherited from Object) |
IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
IJavaPeerable.Finalized() | (Inherited from Object) |
IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |