Struct Instant
Inherited Members
Namespace: NodaTime
Assembly: NodaTime.dll
Syntax
[TypeConverter(typeof(InstantTypeConverter))]
public readonly struct Instant : IEquatable<Instant>, IComparable<Instant>, IFormattable, IComparable, IXmlSerializable
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Properties
MaxValue
Declaration
public static Instant MaxValue { get; }
Property Value
Type | Description |
---|---|
Instant |
Remarks
MinValue
Declaration
public static Instant MinValue { get; }
Property Value
Type | Description |
---|---|
Instant |
Remarks
Methods
Add(Instant, Duration)
operator+()
.
Declaration
public static Instant Add(Instant left, Duration right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Duration | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
Instant | A new Instant representing the sum of the given values. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
AddSchema(XmlSchemaSet)
xmlSchemaSet
.
Declaration
public static XmlQualifiedName AddSchema(XmlSchemaSet xmlSchemaSet)
Parameters
Type | Name | Description |
---|---|---|
XmlSchemaSet | xmlSchemaSet | The XML schema set provided by XmlSchemaExporter. |
Returns
Type | Description |
---|---|
XmlQualifiedName | The qualified name of the schema type that was added to the xmlSchemaSet . |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
CompareTo(Instant)
Declaration
public int CompareTo(Instant other)
Parameters
Type | Name | Description |
---|---|---|
Instant | other | An object to compare with this object. |
Returns
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
int |
A 32-bit signed integer that indicates the relative order of the objects being compared.
The return value has the following meanings:
|
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Equals(Instant)
Declaration
public bool Equals(Instant other)
Parameters
Type | Name | Description |
---|---|---|
Instant | other | The value to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
true if the value of this instant is equal to the value of the other parameter;
otherwise, false.
|
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Equals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The Object to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
true if the specified Object is equal to this instance;
otherwise, false .
|
Overrides
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
FromDateTimeOffset(DateTimeOffset)
Declaration
public static Instant FromDateTimeOffset(DateTimeOffset dateTimeOffset)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset | dateTimeOffset | Date and time value with an offset. |
Returns
Type | Description |
---|---|
Instant | An Instant value representing the same instant in time as the given DateTimeOffset. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
FromDateTimeUtc(DateTime)
Declaration
public static Instant FromDateTimeUtc(DateTime dateTime)
Parameters
Type | Name | Description |
---|---|---|
DateTime | dateTime | Date and time value which must have a Kind of Utc |
Returns
Type | Description |
---|---|
Instant | An Instant value representing the same instant in time as the given universal DateTime. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Exceptions
Type | Condition |
---|---|
ArgumentException | dateTime is not of Kind
Utc. |
FromJulianDate(double)
Declaration
public static Instant FromJulianDate(double julianDate)
Parameters
Type | Name | Description |
---|---|---|
double | julianDate | The number of days since the Julian Epoch to convert into an Instant. |
Returns
Type | Description |
---|---|
Instant | An Instant value which is julianDate days after the Julian Epoch. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
FromUnixTimeMilliseconds(long)
Declaration
public static Instant FromUnixTimeMilliseconds(long milliseconds)
Parameters
Type | Name | Description |
---|---|---|
long | milliseconds | Number of milliseconds since the Unix epoch. May be negative (for instants before the epoch). |
Returns
Type | Description |
---|---|
Instant | An Instant at exactly the given number of milliseconds since the Unix epoch. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | The constructed instant would be out of the range representable in Noda Time. |
FromUnixTimeSeconds(long)
Declaration
public static Instant FromUnixTimeSeconds(long seconds)
Parameters
Type | Name | Description |
---|---|---|
long | seconds | Number of seconds since the Unix epoch. May be negative (for instants before the epoch). |
Returns
Type | Description |
---|---|
Instant | An Instant at exactly the given number of seconds since the Unix epoch. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | The constructed instant would be out of the range representable in Noda Time. |
FromUnixTimeTicks(long)
Declaration
public static Instant FromUnixTimeTicks(long ticks)
Parameters
Type | Name | Description |
---|---|---|
long | ticks | Number of ticks since the Unix epoch. May be negative (for instants before the epoch). |
Returns
Type | Description |
---|---|
Instant | An Instant at exactly the given number of ticks since the Unix epoch. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
FromUtc(int, int, int, int, int, int)
Declaration
public static Instant FromUtc(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute)
Parameters
Type | Name | Description |
---|---|---|
int | year | The year. This is the "absolute year", so a value of 0 means 1 BC, for example. |
int | monthOfYear | The month of year. |
int | dayOfMonth | The day of month. |
int | hourOfDay | The hour. |
int | minuteOfHour | The minute. |
int | secondOfMinute | The second. |
Returns
Type | Description |
---|---|
Instant | An Instant value representing the given date and time in UTC and the ISO calendar. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
FromUtc(int, int, int, int, int)
Declaration
public static Instant FromUtc(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour)
Parameters
Type | Name | Description |
---|---|---|
int | year | The year. This is the "absolute year", so a value of 0 means 1 BC, for example. |
int | monthOfYear | The month of year. |
int | dayOfMonth | The day of month. |
int | hourOfDay | The hour. |
int | minuteOfHour | The minute. |
Returns
Type | Description |
---|---|
Instant | An Instant value representing the given date and time in UTC and the ISO calendar. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
InUtc()
Declaration
public ZonedDateTime InUtc()
Returns
Type | Description |
---|---|
ZonedDateTime | A ZonedDateTime for the same instant, in the UTC time zone and the ISO-8601 calendar |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
InZone(DateTimeZone, CalendarSystem)
Declaration
public ZonedDateTime InZone(DateTimeZone zone, CalendarSystem calendar)
Parameters
Type | Name | Description |
---|---|---|
DateTimeZone | zone | The time zone in which to represent this instant. |
CalendarSystem | calendar | The calendar system in which to represent this instant. |
Returns
Type | Description |
---|---|
ZonedDateTime | A ZonedDateTime for the same instant, in the given time zone and calendar |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
InZone(DateTimeZone)
Declaration
public ZonedDateTime InZone(DateTimeZone zone)
Parameters
Type | Name | Description |
---|---|---|
DateTimeZone | zone | The time zone in which to represent this instant. |
Returns
Type | Description |
---|---|
ZonedDateTime | A ZonedDateTime for the same instant, in the given time zone and the ISO-8601 calendar |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Max(Instant, Instant)
Declaration
public static Instant Max(Instant x, Instant y)
Parameters
Type | Name | Description |
---|---|---|
Instant | x | The first instant to compare. |
Instant | y | The second instant to compare. |
Returns
Type | Description |
---|---|
Instant | The later instant of x or y . |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Min(Instant, Instant)
Declaration
public static Instant Min(Instant x, Instant y)
Parameters
Type | Name | Description |
---|---|---|
Instant | x | The first instant to compare. |
Instant | y | The second instant to compare. |
Returns
Type | Description |
---|---|
Instant | The earlier instant of x or y . |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Minus(Duration)
operator-()
.
Declaration
public Instant Minus(Duration duration)
Parameters
Type | Name | Description |
---|---|---|
Duration | duration | The duration to subtract |
Returns
Type | Description |
---|---|
Instant | A new Instant representing the result of the subtraction. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Minus(Instant)
operator-()
.
Declaration
public Duration Minus(Instant other)
Parameters
Type | Name | Description |
---|---|---|
Instant | other | The other instant to subtract |
Returns
Type | Description |
---|---|
Duration | A new Instant representing the result of the subtraction. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Plus(Duration)
operator+()
.
Declaration
public Instant Plus(Duration duration)
Parameters
Type | Name | Description |
---|---|---|
Duration | duration | The duration to add |
Returns
Type | Description |
---|---|
Instant | A new Instant representing the result of the addition. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
PlusNanoseconds(long)
Declaration
public Instant PlusNanoseconds(long nanoseconds)
Parameters
Type | Name | Description |
---|---|---|
long | nanoseconds | The nanoseconds to add to this instant to create the return value. |
Returns
Type | Description |
---|---|
Instant | The result of adding the given number of ticks to this instant. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
PlusTicks(long)
Declaration
public Instant PlusTicks(long ticks)
Parameters
Type | Name | Description |
---|---|---|
long | ticks | The ticks to add to this instant to create the return value. |
Returns
Type | Description |
---|---|
Instant | The result of adding the given number of ticks to this instant. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Subtract(Instant, Duration)
operator-()
.
Declaration
public static Instant Subtract(Instant left, Duration right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Duration | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
Instant | A new Instant representing the difference of the given values. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Subtract(Instant, Instant)
operator-()
.
Declaration
public static Duration Subtract(Instant left, Instant right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Instant | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
Duration | A new Duration representing the difference of the given values. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
ToDateTimeOffset()
Declaration
public DateTimeOffset ToDateTimeOffset()
Returns
Type | Description |
---|---|
DateTimeOffset | A DateTimeOffset representing the same instant in time as this value. |
Remarks
If the date and time is not on a tick boundary (the unit of granularity of DateTime) the value will be truncated towards the start of time.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The final date/time is outside the range of DateTimeOffset . |
ToDateTimeUtc()
Declaration
public DateTime ToDateTimeUtc()
Returns
Type | Description |
---|---|
DateTime | A DateTime representing the same instant in time as this value, with a kind of "universal". |
Remarks
If the date and time is not on a tick boundary (the unit of granularity of DateTime) the value will be truncated towards the start of time.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The final date/time is outside the range of DateTime . |
ToJulianDate()
Declaration
public double ToJulianDate()
Returns
Type | Description |
---|---|
double | The number of days (including fractional days) since the Julian Epoch. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The value of the current instance in the default format pattern ("g"), using the current thread's culture to obtain a format provider. |
Overrides
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
ToString(string?, IFormatProvider?)
Declaration
public string ToString(string? patternText, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
string | patternText | The String specifying the pattern to use, or null to use the default format pattern ("g"). |
IFormatProvider | formatProvider | The IFormatProvider to use when formatting the value, or null to use the current thread's culture to obtain a format provider. |
Returns
Type | Description |
---|---|
string | A String containing the value of the current instance in the specified format. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
ToUnixTimeMilliseconds()
Declaration
public long ToUnixTimeMilliseconds()
Returns
Type | Description |
---|---|
long | The number of milliseconds since the Unix epoch. |
Remarks
ToUnixTimeSeconds()
Declaration
public long ToUnixTimeSeconds()
Returns
Type | Description |
---|---|
long | The number of seconds since the Unix epoch. |
Remarks
ToUnixTimeTicks()
Declaration
public long ToUnixTimeTicks()
Returns
Type | Description |
---|---|
long | The number of ticks since the Unix epoch. |
Remarks
WithOffset(Offset, CalendarSystem)
Declaration
public OffsetDateTime WithOffset(Offset offset, CalendarSystem calendar)
Parameters
Type | Name | Description |
---|---|---|
Offset | offset | The offset from UTC with which to represent this instant. |
CalendarSystem | calendar | The calendar system in which to represent this instant. |
Returns
Type | Description |
---|---|
OffsetDateTime | An OffsetDateTime for the same instant, with the given offset and calendar |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
WithOffset(Offset)
Declaration
public OffsetDateTime WithOffset(Offset offset)
Parameters
Type | Name | Description |
---|---|---|
Offset | offset | The offset from UTC with which to represent this instant. |
Returns
Type | Description |
---|---|
OffsetDateTime | An OffsetDateTime for the same instant, with the given offset in the ISO calendar system |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
Operators
operator +(Instant, Duration)
Declaration
public static Instant operator +(Instant left, Duration right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Duration | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
Instant | A new Instant representing the sum of the given values. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
operator ==(Instant, Instant)
Declaration
public static bool operator ==(Instant left, Instant right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Instant | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
bool | true if values are equal to each other, otherwise false . |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
operator >(Instant, Instant)
Declaration
public static bool operator >(Instant left, Instant right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Instant | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
bool | true if the left value is greater than the right value, otherwise false . |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
operator >=(Instant, Instant)
Declaration
public static bool operator >=(Instant left, Instant right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Instant | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
bool | true if the left value is greater than or equal to the right value, otherwise false . |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
operator !=(Instant, Instant)
Declaration
public static bool operator !=(Instant left, Instant right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Instant | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
bool | true if values are not equal to each other, otherwise false . |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
operator <(Instant, Instant)
Declaration
public static bool operator <(Instant left, Instant right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Instant | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
bool | true if the left value is less than the right value, otherwise false . |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
operator <=(Instant, Instant)
Declaration
public static bool operator <=(Instant left, Instant right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Instant | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
bool | true if the left value is less than or equal to the right value, otherwise false . |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
operator -(Instant, Duration)
Declaration
public static Instant operator -(Instant left, Duration right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Duration | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
Instant | A new Instant representing the difference of the given values. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.
operator -(Instant, Instant)
Declaration
public static Duration operator -(Instant left, Instant right)
Parameters
Type | Name | Description |
---|---|---|
Instant | left | The left hand side of the operator. |
Instant | right | The right hand side of the operator. |
Returns
Type | Description |
---|---|
Duration | A new Duration representing the difference of the given values. |
Remarks
An Instant has no concept of a particular time zone or calendar: it simply represents a point in time that can be globally agreed-upon.
Equality and ordering comparisons are defined in the natural way, with earlier points on the timeline being considered "less than" later points.
The default value of this type is UnixEpoch, i.e. the instant which can be represented as 1970-01-01T00:00:00Z in the ISO calendar.