PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Date format change

  1. How can I use "strtotime" to change a text date input field to a datetime value to store in db? Is there a function to insert in functions.php?

    Posted 12 years ago on Friday February 17, 2012 | Permalink
  2. Hi, monkeyproof,

    Take a look at the code I added to this topic - http://www.gravityhelp.com/forums/topic/creating-publish-date-from-date-field . In that code, I took fields from the form for the date and time and combined them to save to the database. The line below is the final code used to format the string correctly to save to the db.

    $post_date = date("Y-m-d H:i:s",strtotime($date_value . " " . $time_value));

    Posted 12 years ago on Thursday February 23, 2012 | Permalink

This topic has been resolved and has been closed to new replies.