TimeUnit
@codification/cutwater-core > TimeUnit
Class
A TimeUnit
represents time durations at a given unit of granularity and provides utility methods to convert across units.
beta:
Hierarchy
TimeUnit
Methods
Methods
toDays
▸ toDays(): number
Defined in TimeUnit.ts:105
Returns the number of days, rounded to the greatest integer less than or equal to, the TimeUnit instance.
Returns: number
the number of days
toHours
▸ toHours(): number
Defined in TimeUnit.ts:95
Returns the number of hours, rounded to the greatest integer less than or equal to, the TimeUnit instance.
Returns: number
the number of hours
toMillis
▸ toMillis(): number
Defined in TimeUnit.ts:65
Returns the number of milliseconds, rounded to the greatest integer less than or equal to, the TimeUnit instance.
Returns: number
the number of milliseconds
toMinutes
▸ toMinutes(): number
Defined in TimeUnit.ts:85
Returns the number of minutes, rounded to the greatest integer less than or equal to, the TimeUnit instance.
Returns: number
the number of minutes
toSeconds
▸ toSeconds(): number
Defined in TimeUnit.ts:75
Returns the number of seconds, rounded to the greatest integer less than or equal to, the TimeUnit instance.
Returns: number
the number of seconds
<Static>
days
▸ days(count: number
): TimeUnit
Defined in TimeUnit.ts:15
Returns a TimeUnit representing the specified number of days.
Parameters:
Name | Type | Description |
---|---|---|
count | number | the number of days |
Returns: TimeUnit a Timeunit representing the number of days
<Static>
hours
▸ hours(count: number
): TimeUnit
Defined in TimeUnit.ts:25
Returns a TimeUnit representing the specified number of hours.
Parameters:
Name | Type | Description |
---|---|---|
count | number | the number of hours |
Returns: TimeUnit a Timeunit representing the number of hours
<Static>
millis
▸ millis(count: number
): TimeUnit
Defined in TimeUnit.ts:35
Returns a TimeUnit representing the specified number of milliseconds.
Parameters:
Name | Type | Description |
---|---|---|
count | number | the number of milliseconds |
Returns: TimeUnit a Timeunit representing the number of milliseconds
<Static>
minutes
▸ minutes(count: number
): TimeUnit
Defined in TimeUnit.ts:45
Returns a TimeUnit representing the specified number of minutes.
Parameters:
Name | Type | Description |
---|---|---|
count | number | the number of minutes |
Returns: TimeUnit a Timeunit representing the number of minutes
<Static>
seconds
▸ seconds(count: number
): TimeUnit
Defined in TimeUnit.ts:55
Returns a TimeUnit representing the specified number of seconds.
Parameters:
Name | Type | Description |
---|---|---|
count | number | the number of seconds |
Returns: TimeUnit a Timeunit representing the number of seconds