Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
struct NodaTime.​OffsetTime
Assembly: NodaTime
Implemented Interfaces
- System.​IEquatable`1
- System.​Xml.​Serialization.​IXmlSerializable
- System.​IFormattable
- System.​Numerics.​IEqualityOperators`3
A combination of a <see cref="T:NodaTime.LocalTime" /> and an <see cref="P:NodaTime.OffsetTime.Offset" /> , to represent a time-of-day at a specific offset from UTC but without any date information.
Properties
public
LocalTime
TimeOfDay
Gets the time-of-day represented by this value.
public
Offset
Offset
Gets the offset from UTC of this value.
<value>The offset from UTC of this value.</value>
public
int
Hour
Gets the hour of day of this offset time, in the range 0 to 23 inclusive.
public
int
ClockHourOfHalfDay
Gets the hour of the half-day of this offset time, in the range 1 to 12 inclusive.
public
int
Minute
Gets the minute of this offset time, in the range 0 to 59 inclusive.
public
int
Second
Gets the second of this offset time within the minute, in the range 0 to 59 inclusive.
public
int
Millisecond
Gets the millisecond of this offset time within the second, in the range 0 to 999 inclusive.
public
int
TickOfSecond
Gets the tick of this offset time within the second, in the range 0 to 9,999,999 inclusive.
public
long
TickOfDay
Gets the tick of this offset time within the day, in the range 0 to 863,999,999,999 inclusive.
Remarks If the value does not fall on a tick boundary, it will be truncated towards zero.
public
int
NanosecondOfSecond
Gets the nanosecond of this offset time within the second, in the range 0 to 999,999,999 inclusive.
public
long
NanosecondOfDay
Gets the nanosecond of this offset time within the day, in the range 0 to 86,399,999,999,999 inclusive.
Methods
public
OffsetTime
WithOffset​(Offset offset)
Creates a new <see cref="T:NodaTime.OffsetTime" /> for the same time-of-day, but with the specified UTC offset.
Returns A new <c>OffsetTime</c> for the same date, but with the specified UTC offset.
offset
The new UTC offset.
public
OffsetTime
With​(System.​Func<​LocalTime, LocalTime> adjuster)
Returns this offset time-of-day, with the given date adjuster applied to it, maintaining the existing offset.
Returns The adjusted offset date.
adjuster
The adjuster to apply.
Remarks
If the adjuster attempts to construct an invalid time-of-day, any exception thrown by
that construction attempt will be propagated through this method.
public
OffsetDateTime
On​(LocalDate date)
Combines this <see cref="T:NodaTime.OffsetTime" /> with the given <see cref="T:NodaTime.LocalDate" />
into an <see cref="T:NodaTime.OffsetDateTime" /> .
Returns The <see cref="T:NodaTime.OffsetDateTime" /> representation of this time-of-day on the given date.
date
The date to combine with this time-of-day.
public
int
GetHashCode​()
Returns a hash code for this offset time.
See the type documentation for a description of equality semantics.
Returns A hash code for this offset time.
public
bool
Equals​(object obj)
Compares two <see cref="T:NodaTime.OffsetTime" /> values for equality.
See the type documentation for a description of equality semantics.
Returns True if the given value is another offset time equal to this one; false otherwise.
obj
The object to compare this offset time with.
public
bool
Equals​(OffsetTime other)
Compares two <see cref="T:NodaTime.OffsetTime" /> values for equality.
See the type documentation for a description of equality semantics.
Returns True if the given value is another offset time equal to this one; false otherwise.
other
The value to compare this offset time with.
public
string
ToString​()
Returns a <see cref="T:System.String" /> that represents this instance.
Returns The value of the current instance 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 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.
AddSchema​(System.​Xml.​Schema.​XmlSchemaSet xmlSchemaSet)
Adds the XML schema type describing the structure of the <see cref="T:NodaTime.OffsetTime" /> XML serialization to the given <paramref name="xmlSchemaSet" /> .
Returns The qualified name of the schema type that was added to the <paramref name="xmlSchemaSet" /> .
xmlSchemaSet
The XML schema set provided by <see cref="T:System.Xml.Serialization.XmlSchemaExporter" /> .
protected
void
Finalize​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object