Title: Setting data explorer dates
Last modified: April 12, 2022

---

# Setting data explorer dates

 *  Resolved [pauhana](https://wordpress.org/support/users/pauhana/)
 * (@pauhana)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/)
 * Hello.
 * I store dates as timestamps within my DB. When I look at records in the Data 
   Explorer, the info is not presented in human readable form. Is there a way to
   get Data Explorer to properly present a date that is a timestamp?
 * Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/#post-15551971)
 * Hi [@pauhana](https://wordpress.org/support/users/pauhana/),
 * You can change the date format in plugin settings. Just scroll down on tab plugin
   until you find the date format setting.
 * Does this help?
    Peter
 *  Thread Starter [pauhana](https://wordpress.org/support/users/pauhana/)
 * (@pauhana)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/#post-15553319)
 * Still unclear.
 * Here is a screenshot of my current settings for dates:
    [https://ibb.co/GnmbXsg](https://ibb.co/GnmbXsg)
 * My date has been confirmed correct, but shows up within the Data Explorer as
   “
   November 30, -0001 12:00 am”. Given the date output setting, I was expecting “
   April 11, 2022”.
 * Where am I going wrong?
 * Thanks for the help!
 *  Thread Starter [pauhana](https://wordpress.org/support/users/pauhana/)
 * (@pauhana)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/#post-15553324)
 * Sorry, wrong graphic.
 * Date format output (WordPress format) is given as “F j, Y”.
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/#post-15554023)
 * Hi [@pauhana](https://wordpress.org/support/users/pauhana/),
 * How do you store the timestamp? Can you share the code?
 * What output do you get from a stand query in the Query Builder?
 * Thanks,
    Peter
 *  Thread Starter [pauhana](https://wordpress.org/support/users/pauhana/)
 * (@pauhana)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/#post-15555157)
 * Here’s a snippet of my code:
 *     ```
             $today = strtotime('today PST');
             if ($today !== false) {
               //DBG $page_text .= 'Today is [' . date("Y-m-d", $today) . ']</br>';
               $db_columns = array('svs_seed_order_date' => $today,
                                   'svs_seed_order_member_id' => $user_id,
                                   'svs_seed_order_set_id' => $new_seed_set_id);
               $wpdb->insert('svs_seed_order', $db_columns, array('%d', '%d','%d'));
             } else {
               $msg = "Internal error: Problem determining today's date.";
             }
       ```
   
 * As I say, the value stored has been confirmed to be fine.
 * Please let me know if there is a better way to go about storing the date…
 *  Thread Starter [pauhana](https://wordpress.org/support/users/pauhana/)
 * (@pauhana)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/#post-15555188)
 * Oh, and as to your second question, the query builder shows the date values to
   be zeroed out; the date column shows as “0000-00-00 00:00:00”.
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/#post-15555780)
 * Hi [@pauhana](https://wordpress.org/support/users/pauhana/),
 * I think your code snippet is the problem. The strtotime return an int which MySQL
   interprets as a wrong format, resulting in a datetime with all zeros. With wpdb-
   >insert it’s better to use current_time:
    [https://developer.wordpress.org/reference/functions/current_time/](https://developer.wordpress.org/reference/functions/current_time/)
 * Does this solve the issue?
 * Thanks,
    Peter
 *  Thread Starter [pauhana](https://wordpress.org/support/users/pauhana/)
 * (@pauhana)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/#post-15561074)
 * Thank you Peter.
 * I ended up having so much trouble trying to get a date interpreted properly, 
   I ended up just storing it as a string. Not optimal, but good enough.
 * Thanks again for the help.
 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/#post-15563382)
 * Hi [@pauhana](https://wordpress.org/support/users/pauhana/),
 * Not sure if this is applicable to your situation, but the simplest solution to
   get rid of these manual actions is to let your DBMS do this for you:
 * `alter table svs_seed_order modify svs_seed_order_date datetime default current_timestamp
   on update current_timestamp`
 * When you remove column svs_seed_order_date from all your insert and update statements
   your DBMS will keep it up to data for you.
 * Hope this helps,
    Peter

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Setting data explorer dates’ is closed to new replies.

 * ![](https://ps.w.org/wp-data-access/assets/icon-256x256.png?rev=3299063)
 * [WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards](https://wordpress.org/plugins/wp-data-access/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-data-access/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-data-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-data-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-data-access/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/setting-data-explorer-dates/#post-15563382)
 * Status: resolved