private static function Braintree_Xml_Generator::_dateTimeToXmlTimestamp in Commerce Braintree 7
converts datetime back to xml schema format @access protected
Parameters
object $dateTime:
Return value
var XML schema formatted timestamp
2 calls to Braintree_Xml_Generator::_dateTimeToXmlTimestamp()
- Braintree_Xml_Generator::_castDateTime in braintree_php/
lib/ Braintree/ Xml/ Generator.php - Braintree_Xml_Generator::_generateXmlAttribute in braintree_php/
lib/ Braintree/ Xml/ Generator.php - convert passed data into an array of attributeType, attributeName, and value dates sent as DateTime objects will be converted to strings @access protected
File
- braintree_php/
lib/ Braintree/ Xml/ Generator.php, line 125
Class
- Braintree_Xml_Generator
- Generates XML output from arrays using PHP's built-in XMLWriter
Code
private static function _dateTimeToXmlTimestamp($dateTime) {
$dateTime
->setTimeZone(new DateTimeZone('UTC'));
return $dateTime
->format('Y-m-d\\TH:i:s') . 'Z';
}