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.
Assembly: Cassandra.dll
Syntax
public class LocalTime : IComparable<LocalTime>, IEquatable<LocalTime>
Constructors
LocalTime(int, int, int, int)
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 |
int |
hour |
A number between 0 and 23 representing the hour portion of the time
|
int |
minute |
A number between 0 and 59 representing the minutes portion of the time
|
int |
second |
A number between 0 and 59 representing the seconds portion of the time
|
int |
nanosecond |
A number between 0 and 999,999,999 representing the seconds portion of the time
|
LocalTime(long)
Creates a new instance based on nanoseconds since midnight.
Declaration
public LocalTime(long totalNanoseconds)
Parameters
Type |
Name |
Description |
long |
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
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
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
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
TotalNanoseconds
Gets the number of nanoseconds since midnight.
Declaration
public long TotalNanoseconds { get; }
Property Value
Methods
CompareTo(LocalTime)
Declaration
public int CompareTo(LocalTime other)
Parameters
Returns
Equals(LocalTime)
Declaration
public bool Equals(LocalTime other)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
Parse(string)
Creates a new LocalTime instance based on the string representation.
Declaration
public static LocalTime Parse(string value)
Parameters
Type |
Name |
Description |
string |
value |
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
operator ==(LocalTime, LocalTime)
Declaration
public static bool operator ==(LocalTime value1, LocalTime value2)
Parameters
Returns
operator >(LocalTime, LocalTime)
Declaration
public static bool operator >(LocalTime value1, LocalTime value2)
Parameters
Returns
operator >=(LocalTime, LocalTime)
Declaration
public static bool operator >=(LocalTime value1, LocalTime value2)
Parameters
Returns
operator !=(LocalTime, LocalTime)
Declaration
public static bool operator !=(LocalTime value1, LocalTime value2)
Parameters
Returns
operator <(LocalTime, LocalTime)
Declaration
public static bool operator <(LocalTime value1, LocalTime value2)
Parameters
Returns
operator <=(LocalTime, LocalTime)
Declaration
public static bool operator <=(LocalTime value1, LocalTime value2)
Parameters
Returns
Implements