Namespace: time
Functions
getUTCToday
▸ getUTCToday(date?
): Date
UTC timestamp for the beginning of today. The concept of “today” is defined in UTC time NOT local time!
Parameters
Name | Type | Description |
---|---|---|
date? |
Date |
Optional Date object to convert to UTC midnight |
Returns
Date
getUTCTomorrow
▸ getUTCTomorrow(date?
): Date
UTC timestamp for the beginning of tomorrow. The concept of “tomorrow” is defined in UTC time NOT local time!
Parameters
Name | Type | Description |
---|---|---|
date? |
Date |
Optional Date object to convert to next day UTC midnight |
Returns
Date
getUTCYesterday
▸ getUTCYesterday(date?
): Date
UTC timestamp for the beginning of yesterday. The concept of “yesterday” is defined in UTC time NOT local time!
Parameters
Name | Type | Description |
---|---|---|
date? |
Date |
Optional Date object to convert to previous day UTC midnight |
Returns
Date
humanTime
▸ humanTime(ms
): Object
Convert milliseconds into human-readable time.
Parameters
Name | Type | Description |
---|---|---|
ms |
number |
Time in milliseconds |
Returns
Object
Name | Type |
---|---|
hours |
number |
minutes |
number |
seconds |
number |
milliseconds
▸ milliseconds(time
): number
Convert human-readable time into milliseconds.
Parameters
Name | Type | Description |
---|---|---|
time |
Object |
Object with hours , minutes and seconds to convert |
time.hours? |
number |
- |
time.minutes? |
number |
- |
time.seconds? |
number |
- |
Returns
number