Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Struct

TimeOfDay

struct TimeOfDay

Module: System.Time
Assembly: System.Runtime.dll
Source file: TimeOfDay.rvn

Inheritance: Object → ValueType → TimeOfDay
Implements: ComparableTo<TimeOfDay>, EquatableTo<TimeOfDay>, Formattable

A time of day with 100-nanosecond precision, without a date or time zone.

Remarks

Valid ticks range from 0 through 863999999999. Hour is 0–23; Minute and Second are 0–59; Millisecond is 0–999. Create and FromTicks return InvalidTimeError for invalid input.

Properties

6 items
FractionTicks: int Gets the fractional-second component in 100-nanosecond ticks.
Hour: int Gets the hour from 0 through 23.
Millisecond: int Gets the millisecond component from 0 through 999.
Minute: int Gets the minute from 0 through 59.
Second: int Gets the second from 0 through 59.
Ticks: long Gets the stored 100-nanosecond tick count.

Methods

14 items
Add(duration: Duration) -> TimeOfDay Adds elapsed ticks modulo one day. Use LocalDateTime.Add to retain the date carry.
CompareTo(other: TimeOfDay) -> int Compares this value with the other value; returns a negative integer, zero or a positive integer for less than, equal to or greater than. Implements ComparableTo<TimeOfDay>.CompareTo
Static member: Create(hour: int, minute: int, second: int, fractionTicks?: int) -> Result<TimeOfDay, InvalidTimeError> Validates the supplied time components and returns the value or its typed validation error.
Equals(other: TimeOfDay) -> bool Tests value equality with the other value. Implements EquatableTo<TimeOfDay>.Equals
Equals(other: object?) -> bool Compares the complete value with a boxed TimeOfDay; null and other types are unequal. Overrides Object.Equals
Static member: FromTicks(ticks: long) -> Result<TimeOfDay, InvalidTimeError> Creates a value from 100-nanosecond ticks; TimeOfDay rejects ticks outside a single day.
GetHashCode() -> int Returns an execution-local value hash consistent with equality; not a persistent identifier. Overrides Object.GetHashCode
GetType() -> TypeInfo Returns metadata for the concrete runtime type of this instance. Inherited from Object.GetType
Static member: Parse(value: string, culture: Culture) -> Result<TimeOfDay, DateTimeParseError> Parses a supported numeric Gregorian value with an explicit culture.
Static member: Parse(value: string) -> Result<TimeOfDay, DateTimeParseError> Parses a supported numeric civil value using Culture.Current.
ToString(culture: Culture) -> string Formats using explicit cultural preferences.
ToString(format: string, culture: Culture) -> string Formats with an explicit culture; unsupported specifiers fault. O/o is invariant. Implements Formattable.ToString
ToString(format: string) -> string Formats with Culture.Current; supported formats are documented by DateTimeFormat.FormatTime.
ToString() -> string Formats using Culture.Current and its fixed time profile. Overrides Object.ToString