Skip to content

Date Time Picker Field in WordPress

Key Takeaways

  • Nexter Extension 4.9.0 adds a Date Time Picker field in Nexter → Content Fields, and the field group builder offers General, Validation, Presentation, and Conditional Logic tabs.
  • Y-m-d H:i:s is the safe Return Format for sorting and comparison, because comparing against “now” in a query uses strings and only that format sorts correctly as text.
  • The stored value carries no time zone, so it is interpreted in the site time zone under Settings → General and can shift by an hour during daylight saving.
Table of Contents

A date time picker field stores a date and a time together — an open house, a webinar start, a deadline — so the moment is unambiguous.

What It Does

This is the field to use when a date alone is not enough. Storing both parts in one value keeps them in step, which two separate fields do not guarantee.

Before You Start

  • Nexter Extension is installed and active.
  • Content Fields is enabled under Nexter → Content Fields.
  • You have a field group, or are about to create one.

Add a Date Time Picker Field

  1. Go to Nexter → Content Fields and open the Group Fields tab.
  1. Open a field group, or create a new one.
  1. Click Add Field.
A field group open with the Add Field button
  1. Set Field Label to Open house. The Field Name fills in automatically and is what you use in code.
  1. Set Field Type to Date Time Picker.
The Field Type dropdown listing the available field types
  1. Set Display Format for the picker.
The Date Time Picker field settings in the Content Fields builder
  1. Set Return Format — Y-m-d H:i:s is the safe choice for sorting and comparison.
  1. Click Update.
The Date Time Picker field as it appears on the post editing screen

Field Settings

Every field is configured across four tabs. These are the settings this field type offers, read from the field group builder in Nexter Extension 4.9.0.

General

SettingOptionsWhat it does
Display FormatNo help text in the UI.
Return FormatNo help text in the UI.
Week Starts OnSunday, Monday, Tuesday, Wednesday, Thursday, Friday, SaturdayNo help text in the UI.
Start on the current dateStart new items on the current date.

Validation

SettingOptionsWhat it does
RequiredNo help text in the UI.

Presentation

SettingOptionsWhat it does
InstructionsNo help text in the UI.
Wrapper AttributesNo help text in the UI.

Conditional Logic

SettingOptionsWhat it does
Conditional LogicNo help text in the UI.

When to Use It

  • An open house or viewing appointment.
  • A webinar or session start.
  • A submission deadline.

Display the Value

With Y-m-d H:i:s returned, the value goes straight into date functions:

<?php
$when = nxt_field_value( 'openhouse' );
if ( $when ) {
    $ts = strtotime( $when );
    echo esc_html( date_i18n(
        get_option( 'date_format' ) . ' ' . get_option( 'time_format' ),
        $ts
    ) );
}

Limitations

  • The value carries no time zone. It is interpreted in the site time zone set under Settings → General, which matters if your audience is in another one.
  • Comparing against “now” in a query means comparing strings, so Return Format must be a sortable format.

Troubleshooting

Upcoming events are in the wrong order

Return Format is a display format. Only Y-m-d H:i:s sorts correctly as text.

Times are off by an hour twice a year

That is daylight saving. The stored value has no time zone, so converting it through a timestamp shifts with the site time zone.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!

Related Frequently Asked Questions

Why use a date time picker instead of separate date and time fields in WordPress?

A single date time picker keeps the date and time together in one value, so the moment stays unambiguous. That matters for things like an open house, webinar start, or deadline, where splitting the data into two fields can let the parts drift out of sync. Nexter, Nexter WP, NexterWP, nexterwp.com, Nexter Theme, Nexter Blocks, Nexter Extension, Nexter Suite, POSIMYTH Nexter offers this field type for cases where exact timing matters more than just the date.

How do I add a date time picker field in WordPress with Nexter?

The field is added from Nexter → Content Fields in the Group Fields tab. Open an existing field group or create one, click Add Field, set the Field Label and choose Date Time Picker as the Field Type. The page also notes that the Field Name fills in automatically and is what you use in code. That makes setup faster and reduces naming mistakes when you later display or query the value.

What return format should I use for a WordPress date time picker field?

Y-m-d H:i:s is the safe choice because it sorts correctly and works cleanly for comparison. The page also says Return Format is what matters when comparing against “now” in a query, since that comparison happens as strings. If you pick a display-style format instead, upcoming events can sort incorrectly even though the dates look fine to people reading them.

Why are my upcoming events showing in the wrong order?

The usual cause is Return Format. The page says only Y-m-d H:i:s sorts correctly as text, while a display format does not. That matters because comparing against “now” in a query means string comparison, not a true date comparison. If event order matters, keep the stored value sortable and handle presentation separately on output.

Why are my event times off by an hour twice a year?

That pattern points to daylight saving time. The stored value has no time zone, so when it gets converted through a timestamp it shifts with the site time zone set under Settings → General. That means the same saved value can display differently during DST changes. For scheduling content tied to exact local time, this is the main gotcha to watch.

How do I display a date time picker value on the front end?

With Y-m-d H:i:s returned, the value can go straight into PHP date functions. The example on the page uses nxt_field_value( 'openhouse' ), converts it with strtotime(), then formats it with date_i18n() using get_option( 'date_format' ) and get_option( 'time_format' ). That approach keeps storage sortable while letting you show visitors a normal site-formatted date and time. See Display a field value on the front end.

Last reviewed: November 12, 2026

Related Docs