title: Twig framework and datetime errors
body: <p>I'm running an events site - powered by PHP/MySQL, on Apache 2.28.
  I can get the HTML table to display as per <a href="http://devzone.zend.com/article/13633" rel="nofollow">http://devzone.zend.com/article/13633</a>.</p>
  
  <p>For this site on localhost, I'm using the Twig framework mentioned at www. twig-project. org</p>
  
  <p>The content is extracted from a local MySQL database:</p>
  
  <p>My code:</p>
  
  <pre><code>    &lt;html&gt;
    &lt;head&gt;
      &lt;style type="text/css"&gt;
        table {
          border-collapse: collapse;
        }        
        tr.heading {      
          font-weight: bolder;
        }        
        td {
          border: 1px solid black;
          padding: 0 0.5em;
        }    
      &lt;/style&gt;  
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h2&gt;Events&lt;/h2&gt;
      &lt;table&gt;
        &lt;tr class="heading"&gt;
          &lt;td&gt;Event time&lt;/td&gt;
          &lt;td&gt;Event name&lt;/td&gt;
        &lt;/tr&gt; 
        {% for d in data %}
        &lt;tr&gt;
          &lt;td&gt;{{ d.evtime|escape }}&lt;/td&gt;
          &lt;td&gt;{{ d.evname|escape }}&lt;/td&gt;
        &lt;/tr&gt; 
        {% endfor %}
      &lt;/table&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>// The PHP file is below</p>
  
  <pre><code>    &lt;?php
  // include and register Twig auto-loader
  include 'Twig/Autoloader.php';
  Twig_Autoloader::register();
  
  // attempt a connection
  try {
    $dbh = new PDO('mysql:dbname=world;host=localhost', 'root', 'MYPASS');
  } catch (PDOException $e) {
    echo "Error: Could not connect. " . $e-&gt;getMessage();
  }
  
  // set error mode
  $dbh-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  
  // attempt some queries
  try {
    // execute SELECT query
    // store each row as an object
    $sql = "SELECT * FROM myeventdb";
    $sth = $dbh-&gt;query($sql);
    while ($row = $sth-&gt;fetchObject()) {
      $data[] = $row;
    }
  
    // close connection, clean up
    unset($dbh); 
  
    // define template directory location
    $loader = new Twig_Loader_Filesystem('templates');
  
    // initialize Twig environment
    $twig = new Twig_Environment($loader);
  
    // load template
    $template = $twig-&gt;loadTemplate('countries.tmpl');
  
    // set template variables
    // render template
    echo $template-&gt;render(array (
      'data' =&gt; $data
    ));
  
  } catch (Exception $e) {
    die ('ERROR: ' . $e-&gt;getMessage());
  }
  ?&gt;
  </code></pre>
  
  <p>However, I can't get the datetime to display as this for my events:
  1:30pm Geography Class</p>
  
  <p>Instead it displays as
  13:30:00 Geography Class</p>
  
  <p>Why is this, and what do I need to fix it, within the Twig syntax?
  I'm fairly new to this, and I had a look through the documentation but there wasn't much on the site about it.</p>
  
  <p>Cheers.</p>