This website is for Vega-Lite v4. Go to the main Vega-Lite homepage for the latest release.

Date Time

Edit this page

A date time definition object (as used in filter transform, scale domain, and axis/legend values) provides a convenient way to specify a date time value (without having to specify a timestamp integer).

A date time definition object must have at least one of the following properties:

Property Type Description
year Number

Integer value representing the year.

quarter Number

Integer value representing the quarter of the year (from 1-4).

month Number | String

One of: (1) integer value representing the month from 1-12. 1 represents January; (2) case-insensitive month name (e.g., "January"); (3) case-insensitive, 3-character short month name (e.g., "Jan").

date Number

Integer value representing the date (day of the month) from 1-31.

day Number | String

Value representing the day of a week. This can be one of: (1) integer value – 1 represents Monday; (2) case-insensitive day name (e.g., "Monday"); (3) case-insensitive, 3-character short day name (e.g., "Mon").

Warning: A DateTime definition object with day** should not be combined with year, quarter, month, or date.

hours Number

Integer value representing the hour of a day from 0-23.

minutes Number

Integer value representing the minute segment of time from 0-59.

seconds Number

Integer value representing the second segment (0-59) of a time value

milliseconds Number

Integer value representing the millisecond segment of time.

For example {"year": 2006, "month": "jan", "date": 1} represents Jan 1, 2006.