XML timestamp through PHP

Hi I want to automatically generate a current timestamp in XML format when I run my PHP script. How do I do this?

Heres the XML section of my code:

$xml = new XMLWriter();



if($res === FALSE) { 
    die(mysql_error()); // TODO: better error handling

while ($row = mysql_fetch_assoc($res)) {

  $xml->writeAttribute('sessionid', $row['sessionid']);
  $xml->writeAttribute('eventid', $row['eventid']);
  $xml->writeAttribute('BetStatus', $row['BetStatus']);
  $xml->writeAttribute('EventStatus', $row['EventStatus']);
  $xml->writeAttribute('activestatusid', $row['activestatusid']);



header('Content-type: text/xml');

Source: xml

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.