title: Convert date to given format from input
body: <p>I need to convert a given date already stored in database to a certain format. I have been trying to google it but can't get it working. </p>
  
  <p><em>The Format as Input</em>: <code>d-j-Y</code> <code>( 06-16-2015 )</code></p>
  
  <p><em>The Format to be converted in:</em> <code>F j, Y</code>  <code>(June 16, 2015)</code></p>
  
  <p><strong>The code I have been trying to convert,</strong></p>
  
  <pre><code>$date               = get_post_meta( $post_id, 'timeline_event_date', true );
  $old_date           = date('d-j-Y', $date);
  $old_date_timestamp = strtotime($old_date);
  $new_date           = date('F j, Y', $old_date_timestamp);
  </code></pre>
  
  <p><strong><code>var_dump(s)</code>:</strong></p>
  
  <ul>
  <li><code>var_dump</code> for <code>$date</code>: <code>string(10) "06-16-2015"</code> </li>
  <li><code>var_dump</code> for <code>$old_date</code>: <code>string(9) "01-1-1970"</code></li>
  <li><code>var_dump</code> for <code>$new_date</code>: <code>string(15) "January 1, 1970"</code></li>
  </ul>
  
  <p><strong>EDIT For The Duplicate Question</strong></p>
  
  <p>The duplicate question you marked has the solution to fix this, but I feel this is a good test case for all of WordPress users who are having the same issue ..</p>