Please wait...

Datetime columns

Video versionA video overview of datetime column in wpDataTables

Datetime columns in wpDataTablesDateTime column type and when to use it

Datetime” column type is used for values that contain both date and time parts. Datetime columns will render the date and time values in the format that you specify on the plugin settings page.

  • Rendering rules: value is casted as a date and time, then formatted using the format defined in the plugin settings.
  • Sorting rules: datetime.
  • Applicable filter types: datetime range.
  • Issues to note:
    • When working with Excel files it’s the best to set the format of Datetime columns as plain text since PHPExcel library that parses Excel files does not parse the Excel date format correctly and this results in wrong rendering of the dates (usually they all get reset to 01/01/1970).
    • When you’re working with MySQL please cast timestamps columns to datetime to avoid problems.

ExampleA demo table with DateTime columns

Date & Time” column in this table is of Datetime type.

wdt_ID Date & Time Home Team Away Team Stadium
1 22/10/2016 01:30 PM Bournemouth Tottenham Dean Court
2 22/10/2016 04:00 PM Arsenal Middlesbrough Emirates Stadium
3 22/10/2016 04:00 PM Burnley Everton Turf Moor
4 22/10/2016 04:00 PM Hull City Stoke City KCOM Stadium
5 22/10/2016 04:00 PM Leicester City Crystal Palace King Power Stadium
6 22/10/2016 04:00 PM Swansea City Watford Liberty Stadium
7 22/10/2016 04:00 PM West Ham United Sunderland London Stadium
8 22/10/2016 06:30 PM Liverpool West Bromwich Albion Anfield
9 23/10/2016 02:30 PM Manchester City Southampton Etihad Stadium
10 23/10/2016 05:00 PM Chelsea Manchester United Stamford Bridge
wdt_ID Date & Time Home Team Away Team Stadium

Datetime column settings

If you created table using “Create a table linked to an existing data source” and “Datetime” column is not rendered well (Some cell values missing) you have to choose “Date input format” which is used in the provided data source. Our plugin guess date format correctly in most cases but in some of them, like if you have dates in string column in Excel etc., you will need to “tell” our plugin which format to expect from your data source.

If you are creating a table using “Create a table by importing data from data source” you should set “Date input format” before you create a table so that date values would be saved in the database in the right format. You will see “Date input format” dropdown in the column block which is “Datetime” column type.

Never miss new features!

Join 2000+ newsletter subscribers

Never miss notifications about new cool features, promotions, giveaways or freebies - subscribe to our newsletter! We send about one mail per month, and do our best to keep our announcements interesting.

We never spam or disclose your address to anyone.