- date_format: documentation ( source)
<?php
$tstamp = "qsdqsdsd";
//Root element products.xml
$doc = new DomDocument('1.0',"utf-8");
$root = $doc->createElement('Products');
$root->setAttribute('TimeStamp', date_format($tstamp, 'Y-m-d H:i:s'));
$root = $doc->appendChild($root);