Date / Time Field

The Date / Time field is used to store a date and time value with an easy to use date / time input.

The Date / Time field can store a date and time value in various formats.

Quick Start

  1. Fill out the Basic Field Settings (Label, Description, and Field Name)
  2. Select Field Type: Date / Time.
  3. Click Save New Field (or Save Field if you’re updating an existing field) to save your field configuration.

Settings

  • Date Format Type
    The options available are:
    • WordPress default
    • Predefined format
      • Date Format (predefined)
        You can choose the predefined format you want to display the date as. The options available for date formatting are:
        • 10/08/2008
        • 10-08-2008
        • 10.08.2008
        • 2008/10/08
        • 2008-10-08
        • 2008.10.08
        • October 8, 2008
        • October 8th, 2008
        • 2008-10-08T11:37:22-05:00
        • 08/10/2008
        • 08-10-2008
        • 08.10.2008
        • 08/Oct/2008
        • 08-Oct-2008
  • Custom format
  • Time Format Type
    The options available are:
    • WordPress default
    • 12 hour
      • Time Format (12 hour)
        The options available for time format (12 hour) are:
        • 11:37 AM
        • 11:37:22 AM
        • 11:37 AM
        • 11:37:22 AM
        • 11:37am
        • 11:37am
        • 11:37
        • 11:37:22
        • 11:37
        • 11:37:22
    • 24 hour
      • Time Format (24 hour)
        The options available for time format (24 hour) are:
        • 11:37 AM
        • 11:37:22 AM
  • Year Range
    Enter a year range to restrict the date within.
  • Allow empty value
    When enabled, this will allow an empty value to be saved. Otherwise, the current date/time will be used.
  • Enable HTML5 Input Field
    When enabled, this will render the field with type="datetime" using the default browser interface. Based on your needs, the browser interface may be a better experience especially for mobile devices. For more details on HTML5 types, you can read the documentation at W3 on Validating Common Input.

Custom PHP Date / Time Formats

Pods supports the PHP standard formats for Date and Time for custom display formatting.

Custom JS Date Formats for Input

Prior to Pods 2.8, we supported custom JS date formats from jQuery UI Datepicker. We no longer use jQuery inputs for fields, however we will continue to support the formats below.

FormatLabel
dDay of the Month (No Leading Zero)
ddDay of the Month (Two Digit)
oDay of the Year (No Leading Zeros)
ooDay of the Year (Three Digit)
DDay name (Short)
DDDay name (Long)
mMonth of the Year (No Leading Zero)
mmMonth of the Year (Two Digit)
MMonth name (Short)
MMMonth name (Long)
yYear (Two Digit)

Custom JS Time Formats for Input

Prior to Pods 2.8, we supported custom JS time formats from jQuery UI Timepicker. We no longer use jQuery inputs for fields, however we will continue to support the formats below.

FormatLabel
HHour with no leading 0 (24 hour)
HHHour with leading 0 (24 hour)
hHour with no leading 0 (12 hour)
hhHour with leading 0 (12 hour)
mMinute with no leading 0
mmMinute with leading 0
sSecond with no leading 0
ssSecond with leading 0
lMilliseconds always with leading 0
cMicroseconds always with leading 0
ta or p for am/pm
TA or P for AM/PM
ttam or pm for am/pm
TTAM or PM for AM/PM
zTimezone
ZTimezone in Iso 8601 format (+04:45)

Year Range Format

Prior to Pods 2.8, we supported yearRange formats from jQuery UI Datepicker. We no longer use jQuery inputs for fields, however we will continue to support the formats below.

FormatExampleLabel
-nn:+nn-5:+5Relative to today’s year
c-nn:c+nnc-5:c+5Relative to the currently selected year
nnnn:nnnn2008:2021Absolute year range
nnnn:-nn2008:-5Combinations of the supported formats

How to Display

Display with a Shortcode

[pods field="my_date_time_field"]

Display with PHP: pods_field_display()

<?php
echo pods_field_display( 'my_date_time_field' );

Display with PHP: $pod->display()

<?php
$pod = pods();

echo $pod->display( 'my_date_time_field' );

Other Helpful Documentation on Working with Fields in Pods

Avatar Field

Extends User Profile with a Gravatar field that is managed under the Media Library as opposed to using Gravatar.com

Code (Syntax Highlighting) Field

The Code (Syntax Highlighting) field is used for multiple line code content.

Color Picker Field

The Color Picker field is useful in situations where a color needs to be able to be chosen and customized.

Conditional Logic for Fields

Conditional Logic for Fields will allow you to show or hide a field based on the value of another field.

Currency Field

The Currency field is used to store numeric, integer, and float currency amounts.

Date Field

The Date field is used to store a date value with an easy to use date input.

Date time fields redirect

Email Field

The Email field allows you to store email addresses with additional validation checks.

File / Image / Video Field

The File / Image / Video field is used to store a relationship to Media attachment(s).

Heading Field

The Heading field is not a normal input field, it will output Heading text between your normal form fields to help organize the form.

HTML Content Field

The HTML Content field is not a normal input field, it will output as HTML itself between your normal form fields to help organize the form.

oEmbed Field

The oEmbed field is used to store a single URL that will use the oEmbed protocol to display remote content.

Password Field

The Password field is used to store single-line text with a basic password input form field.

Phone Field

The Phone field is used for telephone numbers in various formats.

Plain Number Field

The Plain Number field is used to store numeric, integer, and float values.

Plain Paragraph Text Field

The Plain Paragraph Text field is used for multiple line text values.

Plain Text Field

The Plain Text field is used for Simple Plain Text Values like a first name, last name, alphanumeric ID or value.

Relationship Field

The Relationship field is used to store related items on various objects in WordPress.

Settings: Advanced

Provides access to the Advanced field options when editing a field.

Settings: Field Details

Basic Field Settings (Label, Name, Description and Field Type) that apply to all Fields created in Pods.

Settings: Reserved List of Names

There are certain names you cannot use for Pod, Group, or Field names in Pods because they are reserved in WordPress or Pods for other uses.

Simple Repeatable Fields

Simple Repeatable Fields will allow you to repeat many different types of fields.

Time Field

The Time field is used to store a date value with an easy to use time input.

Website Field

The Website field is used to store a URL or Website Address or Link to a Website.

WYSIWYG (Visual Editor) Field

The WYSIWYG (Visual Editor) field is used for multiple line HTML content.

Yes / No Field

The Yes / No field offers customizable labels and display options for checkbox, radio buttons, or a drop-down input.