Class to use to describe a time duration.
Example
@Property({
displayName: 'Remaining time',
description: 'Remaining time before the end.',
defaultValue: Time.Zero,
type: Time
})
public remainingTime: Time;
- Zero
- One
- strTime
- strTimeWithoutMilliseconds
- totalSeconds
- totalIntegerSeconds
- totalMilliseconds
- hours
- minutes
- seconds
• new Time(hours
, minutes
, seconds
)
Create a new time with given hours, minutes and seconds.
Name | Type | Description |
---|---|---|
hours |
number |
hours of the time |
minutes |
number |
minutes of the time |
seconds |
number |
seconds of the time |
▪ Static
Readonly
Zero: Time
Instance of time representing an empty duration of zero.
▪ Static
Readonly
One: Time
Instance of time representing a duration of 1 second.
• Readonly
strTime: string
Time in string format
• Readonly
strTimeWithoutMilliseconds: string
Time in string format without milliseconds
• Readonly
totalSeconds: number
Total time in seconds including ms
• Readonly
totalIntegerSeconds: number
Total time in seconds without ms
• Readonly
totalMilliseconds: number
Total time in ms
• Readonly
hours: number
hours of the time
• Readonly
minutes: number
minutes of the time
• Readonly
seconds: number
seconds of the time
▸ Static
convertFrom(value
): Time
Convert a value to a Time
Name | Type | Description |
---|---|---|
value |
unknown |
Value can be converted from string or number . If string , it's parsed with the format hh:mm:ss.ms . If number , it's considered as a number of seconds. |
▸ Static
canConvertFrom(value
): boolean
Check if we can convert value to Time
Name | Type |
---|---|
value |
unknown |
boolean
▸ Static
fromSeconds(value
): Time
Convert from seconds to time
Name | Type |
---|---|
value |
number |
▸ toString(withoutMilliseconds?
): string
Convert time to string
Name | Type | Default value | Description |
---|---|---|---|
withoutMilliseconds |
boolean |
false |
show milliseconds in string result |
string
▸ canConvertTo(type
): boolean
Check if the type can be converted
Name | Type |
---|---|
type |
unknown |
boolean
▸ convertTo(type
): unknown
Function to convert a Time to another type
Name | Type |
---|---|
type |
unknown |
unknown
Found a problem, a bug? Or need some help?
Please do not create an issue in Github! Ask us via our Support page : https://support.intuiface.com/