2018-01-03 20:14:15 -02:00
---
2018-08-14 11:33:13 -06:00
label: "DateTime"
2018-07-25 07:47:26 -04:00
target: datetime
2018-01-03 20:14:15 -02:00
---
The datetime widget translates a datetime picker to a datetime string. For saving the date only, use the date widget.
- **Name:** `datetime`
- **UI:** datetime picker
- **Data type:** Moment.js-formatted datetime string
- **Options:**
- `default` : accepts a datetime string, or an empty string to accept blank input; otherwise defaults to current datetime
2018-05-25 12:03:44 -04:00
- `format` : optional; accepts Moment.js [tokens ](https://momentjs.com/docs/#/parsing/string-format/ ); defaults to raw Date object (if supported by output format)
2018-01-03 20:14:15 -02:00
- **Example:**
2018-08-14 07:37:07 -07:00
```yaml
2018-08-14 11:33:13 -06:00
- label: "Start time"
name: "start"
widget: "datetime"
default: ""
format: "LLL"
2018-08-14 07:37:07 -07:00
```