Noda Time
Instant Structure
NamespacesNodaTimeInstant

[This is preliminary documentation and is subject to change.]

Represents an instant on the global timeline.
Declaration Syntax
C#Visual BasicVisual C++
public struct Instant : IEquatable<Instant>, 
	IComparable<Instant>, IFormattable, IComparable, IXmlSerializable
Public Structure Instant _
	Implements IEquatable(Of Instant), IComparable(Of Instant),  _
	IFormattable, IComparable, IXmlSerializable
public value class Instant : IEquatable<Instant>, 
	IComparable<Instant>, IFormattable, IComparable, IXmlSerializable
Members
All MembersConstructorsMethodsPropertiesFields



IconMemberDescription
Instant(Int64)
Initializes a new instance of the Instant struct.

Add(Instant, Duration)
Adds a duration to an instant. Friendly alternative to operator+().

Addition(Instant, Duration)
Implements the operator + (addition) for Instant + Duration.

CompareTo(Instant)
Compares the current object with another object of the same type.

Equality(Instant, Instant)
Implements the operator == (equality).

Equals(Object)
Determines whether the specified Object is equal to this instance.
(Overrides ValueType.Equals(Object).)
Equals(Instant)
Indicates whether the value of this instant is equal to the value of the specified instant.

FromDateTimeOffset(DateTimeOffset)
Converts a DateTimeOffset into a new Instant representing the same instant in time. Note that the offset information is not preserved in the returned Instant.

FromDateTimeUtc(DateTime)
Converts a DateTime into a new Instant representing the same instant in time.

FromMillisecondsSinceUnixEpoch(Int64)
Initializes a new instance of the Instant struct based on a number of milliseconds since the Unix epoch of (ISO) January 1st 1970, midnight, UTC.

FromSecondsSinceUnixEpoch(Int64)
Initializes a new instance of the Instant struct based on a number of seconds since the Unix epoch of (ISO) January 1st 1970, midnight, UTC.

FromTicksSinceUnixEpoch(Int64)
Initializes a new instance of the Instant struct based on a number of ticks since the Unix epoch of (ISO) January 1st 1970, midnight, UTC.

FromUtc(Int32, Int32, Int32, Int32, Int32)
Returns a new instant corresponding to the given UTC date and time in the ISO calendar. In most cases applications should use ZonedDateTime to represent a date and time, but this method is useful in some situations where an Instant is required, such as time zone testing.

FromUtc(Int32, Int32, Int32, Int32, Int32, Int32)
Returns a new instant corresponding to the given UTC date and time in the ISO calendar. In most cases applications should use ZonedDateTime to represent a date and time, but this method is useful in some situations where an Instant is required, such as time zone testing.

GetHashCode()()()()
Returns a hash code for this instance.
(Overrides ValueType.GetHashCode()()()().)
GreaterThan(Instant, Instant)
Implements the operator > (greater than).

GreaterThanOrEqual(Instant, Instant)
Implements the operator >= (greater than or equal).

Inequality(Instant, Instant)
Implements the operator != (inequality).

InUtc()()()()
Returns the ZonedDateTime representing the same point in time as this instant, in the UTC time zone and ISO-8601 calendar. This is a shortcut for calling InZone(DateTimeZone) with an argument of Utc.

InZone(DateTimeZone)
Returns the ZonedDateTime representing the same point in time as this instant, in the specified time zone and ISO-8601 calendar.

InZone(DateTimeZone, CalendarSystem)
Returns the ZonedDateTime representing the same point in time as this instant, in the specified time zone and calendar system.

LessThan(Instant, Instant)
Implements the operator < (less than).

LessThanOrEqual(Instant, Instant)
Implements the operator <= (less than or equal).

Max(Instant, Instant)
Returns the later instant of the given two.

MaxValue
Represents the largest possible Instant.

Min(Instant, Instant)
Returns the earlier instant of the given two.

Minus(Instant)
Returns the result of subtracting another instant from this one, for a fluent alternative to operator-().

Minus(Duration)
Returns the result of subtracting a duration from this instant, for a fluent alternative to operator-().

MinValue
Represents the smallest possible Instant.

Plus(Duration)
Returns the result of adding a duration to this instant, for a fluent alternative to operator+().

PlusTicks(Int64)
Returns a new value of this instant with the given number of ticks added to it.

Subtract(Instant, Instant)
Subtracts one instant from another. Friendly alternative to operator-().

Subtract(Instant, Duration)
Subtracts a duration from an instant. Friendly alternative to operator-().

Subtraction(Instant, Instant)
Implements the operator - (subtraction) for Instant - Instant.

Subtraction(Instant, Duration)
Implements the operator - (subtraction) for Instant - Duration.

Ticks
The number of ticks since the Unix epoch. Negative values represent instants before the Unix epoch.

ToDateTimeOffset()()()()
Constructs a DateTimeOffset from this Instant which has an offset of zero.

ToDateTimeUtc()()()()
Constructs a DateTime from this Instant which has a Kind of Utc and represents the same instant of time as this value.

ToString()()()()
Returns a String that represents this instance.
(Overrides ValueType.ToString()()()().)
ToString(String, IFormatProvider)
Formats the value of the current instance using the specified pattern.

Remarks

An instant is defined by an integral number of 'ticks' since the Unix epoch (typically described as January 1st 1970, midnight, UTC, ISO calendar), where a tick is equal to 100 nanoseconds. There are 10,000 ticks in a millisecond.

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.

Thread Safety
This type is an immutable value type. See the thread safety section of the user guide for more information.

Assembly: NodaTime (Module: NodaTime.dll) Version: 1.2.0.0 (1.2.0)