Skip to main content
Version: Next

Type alias: Time

Time: UTCTimestamp | BusinessDay | string

The Time type is used to represent the time of data items.

Values can be a UTCTimestamp, a BusinessDay, or a business day string in YYYY-MM-DD format.

Business day strings must be exactly YYYY-MM-DD with zero-padded month and day (for example '2021-02-03'). Any other string, such as '2021-2-3', '2021/02/03' or 'Feb 3 2021', throws an error. If your dates are not in this format, use a BusinessDay object instead.

Example​

const timestamp = 1529899200; // Literal timestamp representing 2018-06-25T04:00:00.000Z
const businessDay = { year: 2019, month: 6, day: 1 }; // June 1, 2019
const businessDayString = '2021-02-03'; // Business day string literal