title: How to format date with value returned as variable in PHP
body: <p>Im working on a WP site using WP Download Manager Pro. I am able to access the object's date like this:</p>
  
  <pre><code>&lt;?php $packageID = get_field('user_submitted_app_download_id'); $post_date = $package['post_date'];?&gt;
  </code></pre>
  
  <p>It is returning the date like this "2018-01-03 10:56:11" I need to re-arrange it so it posts like this "03-01-2018" -> m-d-Y</p>
  
  <p>I keep getting errors and don't know what I'm doing wrong. From PHP.net - </p>
  
  <p><code>&lt;?php $post_date = $package['post_date']; echo date_format($post_date, m-d-Y); ?&gt;</code></p>
  
  <p>I get this laundry list of errors:</p>
  
  <blockquote>
    <p>Notice: Use of undefined constant m - assumed 'm' in
    /home/ntecosys/sandboxwp2/wp-content/plugins/facetwp/includes/class-renderer.php(467)
    : eval()'d code on line 18</p>
    
    <p>Notice: Use of undefined constant d - assumed 'd' in
    /home/ntecosys/sandboxwp2/wp-content/plugins/facetwp/includes/class-renderer.php(467)
    : eval()'d code on line 18</p>
    
    <p>Notice: Use of undefined constant Y - assumed 'Y' in
    /home/ntecosys/sandboxwp2/wp-content/plugins/facetwp/includes/class-renderer.php(467)
    : eval()'d code on line 18</p>
    
    <p>Warning: date_format() expects parameter 1 to be DateTimeInterface,
    string given in
    /home/ntecosys/sandboxwp2/wp-content/plugins/facetwp/includes/class-renderer.php(467)
    : eval()'d code on line 18</p>
  </blockquote>
  
  <p>How do I reformat the date?</p>