Choose your preferred SSG:
Choose your preferred SSG:

Using Date and Time Inputs to edit your data

These inputs are for editing date and time values in your data.

If timezone is set in your global configuration, date values are saved with the matching offset suffix. If unset, date values are saved without an offset suffix in UTC.

For Jekyll sites, date values are saved in the Jekyll-expected format (e.g. 2021-01-09 00:00:00) rather than standard ISO 8601.

Datetime

Combination date picker and 12-hour time input.

Datetime inputs are shown for inputs configured with the type datetime, for date input values, or for input keys matching:

  • date
  • datetime
  • *_datetime
  • at
  • *_at
Screenshot of datetime input field unfocused
Naming convention
date: 2020-07-15T12:00:00Z
Input configuration
when: 2020-07-15T12:00:00Z
_inputs:
  when:
    type: datetime

Date

Date picker input for date values with year, month, and day.

Date inputs are shown for inputs configured with the type date, or for inputs keys matching:

  • *_date
Screenshot of date input field unfocused
Screenshot of date input field focused
Naming convention
sale_start_date: 2021-01-09T00:00:00Z
Input configuration
due_by: 2021-01-09T00:00:00Z
_inputs:
  due_by:
    type: date
  
Note

The time value is always added for Date inputs as 00:00:00 for consistency with Datetime inputs.

Time

Single line 12-hour time input for strings of time values.

Time inputs are shown for inputs configured with the type time, or for input keys matching:

  • time
  • *_time
Screenshot of time input field
Naming convention
opening_time: 8:00 am
Input configuration
doors_open: 8:00 am
_inputs:
  doors_open:
    type: time

Options

Date, Datetime and Time input options are configured with options inside an _inputs entry.

timezone - String

Specifies the time zone that dates are displayed and edited in. Also changes the suffix the date is persisted to the file with. Must be in the tz database name format (e.g. Pacific/Auckland or America/New_York). Defaults to the timezone configured in your global configuration file, which defaults to Etc/UTC.

Available on Date and Datetime inputs, has no effect on Time inputs.

Was this article helpful? or Suggest an improvement >

Other Resources

  1. List of tz database time zones