Class LocalTime
A time without a time-zone in the ISO-8601 calendar system, such as 10:30:05.
LocalTime is an immutable date-time object that represents a time, often viewed as hour-minute-second.
Time is represented to nanosecond precision. For example, the value "13:45.30.123456789" can be stored in a LocalTime.
Inheritance
System.Object
LocalTime
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Dse
Assembly: Dse.dll
Syntax
public class LocalTime : IComparable<LocalTime>, IEquatable<LocalTime>
Constructors
LocalTime(Int32, Int32, Int32, Int32)
Creates a new instance based on the specified hour, minutes, seconds, millis and nanoseconds.
Declaration
public LocalTime(int hour, int minute, int second, int nanosecond)
Parameters
Type |
Name |
Description |
System.Int32 |
hour |
A number between 0 and 23 representing the hour portion of the time
|
System.Int32 |
minute |
A number between 0 and 59 representing the minutes portion of the time
|
System.Int32 |
second |
A number between 0 and 59 representing the seconds portion of the time
|
System.Int32 |
nanosecond |
A number between 0 and 999,999,999 representing the seconds portion of the time
|
LocalTime(Int64)
Creates a new instance based on nanoseconds since midnight.
Declaration
public LocalTime(long totalNanoseconds)
Parameters
Type |
Name |
Description |
System.Int64 |
totalNanoseconds |
Nanoseconds since midnight. Valid values are in the range 0 to 86399999999999.
|
Properties
Hour
Gets the hour component of the time represented by the current instance, a number from 0 to 23.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
Minute
Gets the minute component of the time represented by the current instance, a number from 0 to 59.
Declaration
public int Minute { get; }
Property Value
Type |
Description |
System.Int32 |
|
Nanoseconds
Gets the nanoseconds component of the time represented by the current instance, a number from 0 to 999,999,999.
Declaration
public int Nanoseconds { get; }
Property Value
Type |
Description |
System.Int32 |
|
Second
Gets the second component of the time represented by the current instance, a number from 0 to 59.
Declaration
public int Second { get; }
Property Value
Type |
Description |
System.Int32 |
|
TotalNanoseconds
Gets the number of nanoseconds since midnight.
Declaration
public long TotalNanoseconds { get; }
Property Value
Type |
Description |
System.Int64 |
|
Methods
CompareTo(LocalTime)
Declaration
public int CompareTo(LocalTime other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
Equals(LocalTime)
Declaration
public bool Equals(LocalTime other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
Parse(String)
Creates a new LocalTime instance based on the string representation.
Declaration
public static LocalTime Parse(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
Operators
Equality(LocalTime, LocalTime)
Declaration
public static bool operator ==(LocalTime value1, LocalTime value2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GreaterThan(LocalTime, LocalTime)
Declaration
public static bool operator>(LocalTime value1, LocalTime value2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GreaterThanOrEqual(LocalTime, LocalTime)
Declaration
public static bool operator >=(LocalTime value1, LocalTime value2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Inequality(LocalTime, LocalTime)
Declaration
public static bool operator !=(LocalTime value1, LocalTime value2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
LessThan(LocalTime, LocalTime)
Declaration
public static bool operator <(LocalTime value1, LocalTime value2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
LessThanOrEqual(LocalTime, LocalTime)
Declaration
public static bool operator <=(LocalTime value1, LocalTime value2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IComparable<T>
System.IEquatable<T>