TimeOnly
Tip
This is a builtin dotnet type. The documentation and api interface are generated from dotnet source files.
Represents a time of day, as would be read from a clock, within the range 00:00:00 to 23:59:59.9999999.
Fields:
Hour number
Gets the hour component of the time represented by this instance.
Microsecond number
Gets the microsecond component of the time represented by this instance.
Millisecond number
Gets the millisecond component of the time represented by this instance.
Minute number
Gets the minute component of the time represented by this instance.
Nanosecond number
Gets the nanosecond component of the time represented by this instance.
Second number
Gets the seconds component of the time represented by this instance.
Ticks number
Gets the number of ticks that represent the time of this instance.
Constructors:
New(ticks: number) :
Initializes a new instance of the TimeOnly structure using a specified number of ticks.
Name | Type | Default | Summary |
ticks | number | A time of day expressed in the number of 100-nanosecond units since 00:00:00.0000000. |
New(hour: number, minute: number) :
Initializes a new instance of the TimeOnly structure to the specified hour and the minute.
Name | Type | Default | Summary |
hour | number | The hours (0 through 23). | |
minute | number | The minutes (0 through 59). |
New(hour: number, minute: number, second: number) :
Initializes a new instance of the TimeOnly structure to the specified hour, minute, and second.
Name | Type | Default | Summary |
hour | number | The hours (0 through 23). | |
minute | number | The minutes (0 through 59). | |
second | number | The seconds (0 through 59). |
New(hour: number, minute: number, second: number, millisecond: number) :
Initializes a new instance of the TimeOnly structure to the specified hour, minute, second, and millisecond.
Name | Type | Default | Summary |
hour | number | The hours (0 through 23). | |
minute | number | The minutes (0 through 59). | |
second | number | The seconds (0 through 59). | |
millisecond | number | The millisecond (0 through 999). |
New(hour: number, minute: number, second: number, millisecond: number, microsecond: number) :
Initializes a new instance of the TimeOnly structure to the specified hour, minute, second, millisecond, and microsecond.
Name | Type | Default | Summary |
hour | number | The hours (0 through 23). | |
minute | number | The minutes (0 through 59). | |
second | number | The seconds (0 through 59). | |
millisecond | number | The millisecond (0 through 999). | |
microsecond | number | The microsecond (0 through 999). |
Methods:
Add(value: TimeSpan) : TimeOnly, number
Returns a new TimeOnly that adds the value of the specified time span to the value of this instance. If the result wraps past the end of the day, this method returns the number of excess days as an out parameter.
Name | Type | Default | Summary |
value | TimeSpan | A positive or negative time interval. |
Type | Summary |
TimeOnly | |
number | When this method returns, contains the number of excess days, if any, that resulted from wrapping during this addition operation. |
AddHours(value: number) : TimeOnly, number
Returns a new TimeOnly that adds the specified number of hours to the value of this instance. If the result wraps past the end of the day, this method returns the number of excess days as an out parameter.
Name | Type | Default | Summary |
value | number | A number of whole and fractional hours. The value parameter can be negative or positive. |
Type | Summary |
TimeOnly | |
number | When this method returns, contains the number of excess days, if any, that resulted from wrapping during this addition operation. |