Class LocalTime
Represents a local time value
public sealed class LocalTime : TemporalValue, IConvertible, IEquatable<LocalTime>, IComparable, IComparable<LocalTime>
- Inheritance
-
LocalTime
- Implements
- Inherited Members
- Extension Methods
Constructors
- LocalTime(DateTime)
Initializes a new instance of LocalTime from time components of given DateTime
- LocalTime(int, int, int)
Initializes a new instance of LocalTime from individual time components
- LocalTime(int, int, int, int)
Initializes a new instance of LocalTime from individual time components
- LocalTime(TimeOnly)
Initializes a new instance of LocalTime from given TimeOnly value
- LocalTime(TimeSpan)
Initializes a new instance of LocalTime from given TimeSpan value
Fields
Properties
- Hour
Gets the hour component of this instance.
- Minute
Gets the minute component of this instance.
- Nanosecond
Gets the nanosecond component of this instance.
- Second
Gets the second component of this instance.
Methods
- CompareTo(LocalTime)
Compares the value of this instance to a specified LocalTime value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.
- CompareTo(object)
Compares the value of this instance to a specified object which is expected to be a LocalTime value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified LocalTime value.
- ConvertToDateTime()
Converts this TemporalValue instance to a DateTime instance.
- ConvertToTimeSpan()
Converts this TemporalValue instance to a TimeSpan instance.
- Equals(LocalTime)
Returns a value indicating whether the value of this instance is equal to the value of the specified LocalTime instance.
- Equals(object)
Returns a value indicating whether this instance is equal to a specified object.
- GetHashCode()
Returns the hash code for this instance.
- ToString()
Converts the value of the current LocalTime object to its equivalent string representation.
- ToTimeOnly()
Converts this time value to a TimeOnly instance.
- ToTimeSpan()
Converts this time value to a TimeSpan instance.
Operators
- operator >(LocalTime, LocalTime)
Determines whether one specified LocalTime is later than another specified LocalTime.
- operator >=(LocalTime, LocalTime)
Determines whether one specified LocalTime represents a duration that is the same as or earlier than the other specified LocalTime
- operator <(LocalTime, LocalTime)
Determines whether one specified LocalTime is earlier than another specified LocalTime.
- operator <=(LocalTime, LocalTime)
Determines whether one specified LocalTime represents a duration that is the same as or later than the other specified LocalTime