public
int
CompareTo​(
Instant64 other)
Compares the current object with another object of the same type.
See the type documentation for a description of ordering semantics.
Returns A 32-bit signed integer that indicates the relative order of the objects being compared.
The return value has the following meanings:
<list type="table">
<listheader>
<term>Value</term>
<description>Meaning</description>
</listheader>
<item>
<term>< 0</term>
<description>This object is less than the <paramref name="other" /> parameter.</description>
</item>
<item>
<term>0</term>
<description>This object is equal to <paramref name="other" />.</description>
</item>
<item>
<term>> 0</term>
<description>This object is greater than <paramref name="other" />.</description>
</item>
</list>
other
An object to compare with this object.
public
bool
Equals​(object obj)
Determines whether the specified <see cref="T:System.Object" /> is equal to this instance.
See the type documentation for a description of equality semantics.
Returns <c>true</c> if the specified <see cref="T:System.Object" /> is equal to this instance;
otherwise, <c>false</c> .
obj
The <see cref="T:System.Object" /> to compare with this instance.
public
int
GetHashCode​()
Returns a hash code for this instance.
See the type documentation for a description of equality semantics.
Returns A hash code for this instance, suitable for use in hashing algorithms and data
structures like a hash table.
PlusTicks​(long ticks)
Returns a new value of this instant with the given number of ticks added to it.
Returns The result of adding the given number of ticks to this instant.
ticks
The ticks to add to this instant to create the return value.
PlusNanoseconds​(long nanoseconds)
Returns a new value of this instant with the given number of nanoseconds added to it.
Returns The result of adding the given number of ticks to this instant.
nanoseconds
The nanoseconds to add to this instant to create the return value.
Add​(
Instant64 left,
Duration64 right)
Adds a duration to an instant. Friendly alternative to <c>operator+()</c> .
Returns A new <see cref="T:NodaTime.HighPerformance.Instant64" /> representing the sum of the given values.
left
The left hand side of the operator.
right
The right hand side of the operator.
Plus​(
Duration64 duration)
Returns the result of adding a duration to this instant, for a fluent alternative to <c>operator+()</c> .
Returns A new <see cref="T:NodaTime.HighPerformance.Instant64" /> representing the result of the addition.
duration
The duration to add
Subtract​(
Instant64 left,
Instant64 right)
Subtracts one instant from another. Friendly alternative to <c>operator-()</c> .
Returns A new <see cref="T:NodaTime.HighPerformance.Duration64" /> representing the difference of the given values.
left
The left hand side of the operator.
right
The right hand side of the operator.
Minus​(
Instant64 other)
Returns the result of subtracting another instant from this one, for a fluent alternative to <c>operator-()</c> .
Returns A new <see cref="T:NodaTime.HighPerformance.Instant64" /> representing the result of the subtraction.
other
The other instant to subtract
Subtract​(
Instant64 left,
Duration64 right)
Subtracts a duration from an instant. Friendly alternative to <c>operator-()</c> .
Returns A new <see cref="T:NodaTime.HighPerformance.Instant64" /> representing the difference of the given values.
left
The left hand side of the operator.
right
The right hand side of the operator.
Minus​(
Duration64 duration)
Returns the result of subtracting a duration from this instant, for a fluent alternative to <c>operator-()</c> .
Returns A new <see cref="T:NodaTime.HighPerformance.Instant64" /> representing the result of the subtraction.
duration
The duration to subtract
FromUtc​(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour)
Returns a new instant corresponding to the given UTC date and time in the ISO calendar.
Returns An <see cref="T:NodaTime.HighPerformance.Instant64" /> value representing the given date and time in UTC and the ISO calendar.
year
The year. This is the "absolute year",
so a value of 0 means 1 BC, for example.
monthOfYear
The month of year.
dayOfMonth
The day of month.
hourOfDay
The hour.
minuteOfHour
The minute.
FromUtc​(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute)
Returns a new instant corresponding to the given UTC date and
time in the ISO calendar.
Returns An <see cref="T:NodaTime.HighPerformance.Instant64" /> value representing the given date and time in UTC and the ISO calendar.
year
The year. This is the "absolute year",
so a value of 0 means 1 BC, for example.
monthOfYear
The month of year.
dayOfMonth
The day of month.
hourOfDay
The hour.
minuteOfHour
The minute.
secondOfMinute
The second.
Returns The later instant of <paramref name="x" /> or <paramref name="y" /> .
x
The first instant to compare.
y
The second instant to compare.
Min​(
Instant64 x,
Instant64 y)
Returns the earlier instant of the given two.
Returns The earlier instant of <paramref name="x" /> or <paramref name="y" /> .
x
The first instant to compare.
y
The second instant to compare.
public
string
ToString​()
Returns a <see cref="T:System.String" /> that represents this instance.
Returns The value of the current instance, converted to an <see cref="T:NodaTime.Instant" /> , in the default format pattern ("g"), using the current thread's
culture to obtain a format provider.
public
string
ToString​(string patternText,
System.​IFormatProvider formatProvider)
Formats the value of the current instance, converted to an <see cref="T:NodaTime.Instant" /> , using the specified pattern.
Returns A <see cref="T:System.String" /> containing the value of the current instance in the specified format.
patternText
The <see cref="T:System.String" /> specifying the pattern to use,
or null to use the default format pattern ("g").
formatProvider
The <see cref="T:System.IFormatProvider" /> to use when formatting the value,
or null to use the current thread's culture to obtain a format provider.
public
bool
Equals​(
Instant64 other)
Indicates whether the value of this instant is equal to the value of the specified instant.
See the type documentation for a description of equality semantics.
Returns true if the value of this instant is equal to the value of the <paramref name="other" /> parameter;
otherwise, false.
other
The value to compare with this instance.
ToDateTimeUtc​()
Constructs a <see cref="T:System.DateTime" /> from this instant which has a <see cref="P:System.DateTime.Kind" />
of <see cref="F:System.DateTimeKind.Utc" /> and represents the same instant of time as this value.
Returns A <see cref="T:System.DateTime" /> representing the same instant in time as this value, with a kind of "universal".
Remarks
<para>
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. Note that this means the result of calling this method on <see cref="P:NodaTime.HighPerformance.Instant64.MinValue" />
is a value which is out of range for <see cref="M:NodaTime.HighPerformance.Instant64.FromDateTimeUtc(System.DateTime)" />.
</para>
ToDateTimeOffset​()
Constructs a <see cref="T:System.DateTimeOffset" /> from this instant which has an offset of zero.
Returns A <see cref="T:System.DateTimeOffset" /> representing the same instant in time as this value.
Remarks
<para>
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. Note that this means the result of calling this method on <see cref="P:NodaTime.HighPerformance.Instant64.MinValue" />
is a value which is out of range for <see cref="M:NodaTime.HighPerformance.Instant64.FromDateTimeOffset(System.DateTimeOffset)" />.
</para>
FromDateTimeOffset​(
System.​DateTimeOffset dateTimeOffset)
Converts a <see cref="T:System.DateTimeOffset" /> into a new instant representing the same instant in time. Note that
the offset information is not preserved in the returned instant.
Returns An <see cref="T:NodaTime.HighPerformance.Instant64" /> value representing the same instant in time as the given <see cref="T:System.DateTimeOffset" /> .
dateTimeOffset
Date and time value with an offset.
FromDateTimeUtc​(
System.​DateTime dateTime)
Converts a <see cref="T:System.DateTime" /> into a new instant representing the same instant in time.
Returns An <see cref="T:NodaTime.HighPerformance.Instant64" /> value representing the same instant in time as the given universal <see cref="T:System.DateTime" /> .
dateTime
Date and time value which must have a <see cref="P:System.DateTime.Kind" /> of <see cref="F:System.DateTimeKind.Utc" />
FromUnixTimeSeconds​(long seconds)
Initializes a new instance of the <see cref="T:NodaTime.HighPerformance.Instant64" /> struct based
on a number of seconds since the Unix epoch of (ISO) January 1st 1970, midnight, UTC.
Returns An <see cref="T:NodaTime.HighPerformance.Instant64" /> at exactly the given number of seconds since the Unix epoch.
seconds
Number of seconds since the Unix epoch. May be negative (for instants before the epoch).
FromUnixTimeMilliseconds​(long milliseconds)
Initializes a new instance of the <see cref="T:NodaTime.HighPerformance.Instant64" /> struct based
on a number of milliseconds since the Unix epoch of (ISO) January 1st 1970, midnight, UTC.
Returns An <see cref="T:NodaTime.HighPerformance.Instant64" /> at exactly the given number of milliseconds since the Unix epoch.
milliseconds
Number of milliseconds since the Unix epoch. May be negative (for instants before the epoch).
FromUnixTimeTicks​(long ticks)
Initializes a new instance of the <see cref="T:NodaTime.HighPerformance.Instant64" /> struct based
on a number of ticks since the Unix epoch of (ISO) January 1st 1970, midnight, UTC.
Returns An <see cref="T:NodaTime.HighPerformance.Instant64" /> at exactly the given number of ticks since the Unix epoch.
ticks
Number of ticks since the Unix epoch. May be negative (for instants before the epoch).
FromUnixTimeNanoseconds​(long nanoseconds)
Initializes a new instance of the <see cref="T:NodaTime.HighPerformance.Instant64" /> struct based
on a number of nanoseconds since the Unix epoch of (ISO) January 1st 1970, midnight, UTC.
Returns An <see cref="T:NodaTime.HighPerformance.Instant64" /> at exactly the given number of seconds since the Unix epoch.
nanoseconds
Number of nanoseconds since the Unix epoch. May be negative (for instants before the epoch).
public
long
ToUnixTimeSeconds​()
Gets the number of seconds since the Unix epoch. Negative values represent instants before the Unix epoch.
Remarks
If the number of nanoseconds in this instant is not an exact number of seconds, the value is truncated towards the start of time.
ToUnixTimeSecondsAndNanoseconds​()
Gets the number of seconds since the Unix epoch, along with remaining nanoseconds.
Negative values for seconds represent instants before the Unix epoch.
Remarks
<para>
If the number of nanoseconds in this instant is not an exact number of seconds
the seconds part of the returned value is truncated towards the start of time, ensuring that
the nanoseconds part is always non-negative. The seconds part of the returned value is always
the same as would be returned by <see cref="M:NodaTime.HighPerformance.Instant64.ToUnixTimeSeconds" />.
</para> <para>
The inverse of this operation is to first call <see cref="M:NodaTime.HighPerformance.Instant64.FromUnixTimeSeconds(System.Int64)" /> and then
call <see cref="M:NodaTime.HighPerformance.Instant64.PlusNanoseconds(System.Int64)" /> on the returned <see cref="T:NodaTime.HighPerformance.Instant64" />.
</para>
public
long
ToUnixTimeMilliseconds​()
Gets the number of milliseconds since the Unix epoch. Negative values represent instants before the Unix epoch.
Remarks
If the number of nanoseconds in this instant is not an exact number of milliseconds, the value is truncated towards the start of time.
public
long
ToUnixTimeTicks​()
Gets the number of ticks since the Unix epoch. Negative values represent instants before the Unix epoch.
Returns The number of ticks since the Unix epoch.
Remarks
A tick is equal to 100 nanoseconds. There are 10,000 ticks in a millisecond. If the number of nanoseconds
in this instant is not an exact number of ticks, the value is truncated towards the start of time.
public
long
ToUnixTimeNanoseconds​()
Gets the number of nanoseconds since the Unix epoch. Negative values represent instants before the Unix epoch.
Returns The number of ticks since the Unix epoch.
ToInstant​()
Converts this value to an <see cref="T:NodaTime.Instant" /> representing the same instant in time.
This operation always succeeds and loses no information.
Returns An <see cref="T:NodaTime.Instant" /> representing the same instant in time as this one.
FromInstant​(
Instant instant)
Creates an <see cref="T:NodaTime.HighPerformance.Instant64" /> value representing the same instant in time as the specified
<see cref="T:NodaTime.Instant" /> . When this succeeds, this conversion loses no information.
If the specified value is outside the range of <see cref="T:NodaTime.HighPerformance.Instant64" /> , this method will fail with an
<see cref="T:System.OverflowException" /> .
Returns An <see cref="T:NodaTime.HighPerformance.Instant64" /> value equivalent to <paramref name="instant" /> .
instant
The value to convert to a <see cref="T:NodaTime.HighPerformance.Instant64" /> .
protected
void
Finalize​()
Inherited from object
GetType​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object