Date and Time field
Purpose
A specific moment: event start, publication time, deadline with a time.
Field type name
date_time
Settings
| Setting | Description |
|---|---|
| Instructions | Shown to editors below the field label. (max 2000 characters) |
| Default Value | Date and time in the site time zone (YYYY-MM-DD HH:MM) returned when nothing has been saved yet. (max 25 characters) |
| Return Format | PHP date format for cafe_get_field(), shown in the site time zone. (max 50 characters) |
| Translation | How the field behaves in other languages: translate, copy, copy_once or do_not_translate. Used on top-level fields when WPML is active. See WPML. |
| Width | Width on edit screens, to place fields side by side: 100 (full), 75, 66, 50, 33 or 25 (%). Phones always show full width. |
| Label per language | The label and instructions per language code while editing in that language, e.g. {"nl": {"label": "Prijs"}}. Set on the Translation tab when WPML is active. See WPML. |
PHP return value
Formatted in the site time zone with Return Format (default Y-m-d H:i:s).
Example
// Site time zone: Europe/Amsterdam (UTC+2 in summer).
cafe_update_field( 'starts_at', '2026-09-21 14:30', $post_id ); // stored as 2026-09-21 12:30:00 (UTC)
echo esc_html( cafe_get_field( 'starts_at', $post_id ) ); // "2026-09-21 14:30:00"