Tagged: 

Viewing 1 reply thread
  • Author
    Posts
    • #3202
      waterschaats
      Member

      I’m using the date-picker meta-box to add a from – to date to my posts. Now I want to order the result by date. To to so I need the date to be formatted like this:20150122. Can I change to display date format of the date-picker apart from the value?

    • #3204
      Steve
      Keymaster

      With Piklist you can use standard WordPress and PHP functions to manipulate data:

      $date = get_post_meta( $post->ID, 'date', true);
      $new_date = date("Y-m-d", strtotime($date));
      
      echo $new_date;
      
      Let me know if that works for you.
Viewing 1 reply thread
  • You must be logged in to reply to this topic.