title: Display Date In HTML Table
body: <p>I am querying SQL Server and creating a table of the result set from the query.  The first two fields in my table display as they should, however the date field is always left blank, which leaves me to see that this field is my issue.  Below is the issue syntax - how should I alter it so that it will actually display my date field in the table?</p>
  
  <pre><code>    $query-&gt;select($db-&gt;quotename(array('UnitID,SaleAmt,SaleDate')));
      $query-&gt;from($db-&gt;quoteName('SaleInformation'));
      $datefield_name = $db-&gt;quoteName('SaleDate');
      $query-&gt;where("$datefield_name &gt;= " . $db-&gt;quote($startdate), 'AND');
      $query-&gt;where("$datefield_name &lt;= " . $db-&gt;quote($enddate));
  } else {
      echo "Please check the selection criteria and process again.";
  }
  $db-&gt;setQuery($query);
  $query = $db-&gt;loadObjectList();
  ?&gt;
  &lt;div id="dvdata"&gt;
      &lt;table id="example" border="1" &gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Job Number &lt;/th&gt;
                  &lt;th&gt;SaleAmt &lt;/th&gt;
                  &lt;th&gt;Sale Date&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;?php
          foreach ($query as $res) {
              print "&lt;tr&gt;";
              print "&lt;td&gt;&lt;a href='http://internallocalhost/test" . $res-&gt; . "' target=_blank&gt;" . $res-&gt;UnitID . "&lt;/a&gt;&lt;/td&gt;";
              print "&lt;td&gt;" . "$" . number_format(round($res-&gt;SaleAmt)) . "&lt;/td&gt;";
              print "&lt;td&gt;" . date('d-m-Y', strtotime($res['SaleDate'])) . "&lt;/td&gt;";
              print "&lt;/tr&gt;";
          }
      }
      ?&gt;
  </code></pre>