Title: Date Display Empty With $record-&gt;get_value()
Last modified: October 26, 2020

---

# Date Display Empty With $record->get_value()

 *  [jermaineholmes](https://wordpress.org/support/users/jermaineholmes/)
 * (@jermaineholmes)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/date-display-empty-with-record-get_value/)
 * I’m using the templating for a custom display. I’ve instantiated PDb_Template()
   and using get_value() to retrieve the value of a date field.
 * $record = new PDb_Template( $this );
    $date_field = $record->get_value(‘start_date’);
 * I’m putting the date field through the date() function and treating the second
   parameter as a string, converting it to time() via strtotime(). However, I’m 
   getting a null value and the date display only shows today’s date. I’m thinking
   that maybe I don’t need the strtotime() function in date, since maybe the data
   is stored as time() format but I haven’t been able to find any documentation 
   that explicitly states this. If I want to use date(), could I just input the 
   value of $date_field or do I still need to use with strtotime()?
 * $date_display = date( ‘YYYY-MM-DD’, strtotime($date_field) );

Viewing 1 replies (of 1 total)

 *  Plugin Author [Roland Barker](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/date-display-empty-with-record-get_value/#post-13582893)
 * Using the “get_value” method on a date field will give you the Unix timestamp,
   so you don’t need strtotime.
 * Also, the format string you’re using isn’t the right kind of format string, you
   need to use a [php Date](https://www.php.net/manual/en/function.date.php) format
   string. Take a look at the linked article for the details.

Viewing 1 replies (of 1 total)

The topic ‘Date Display Empty With $record->get_value()’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Roland Barker](https://wordpress.org/support/users/xnau/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/date-display-empty-with-record-get_value/#post-13582893)
 * Status: not resolved