我想从 PHP 生成 XML 格式的日期,
以下是我希望动态生成的脚本:
$voice.trackTransactionPageView({
"orderId" : "55555",
"total" : "40.84",
"userId" : "7448dc2",
"email" : "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="442e2b2c2a04213c25293428216a272b29" rel="noreferrer noopener nofollow">[email protected]</a>",
"nickname" : "john1981",
"deliveryDate" : "2011-01-21T11:36:47.384",
"locale" : "en_US"
});
如果您在上面的代码中看到,我的 deliveryDate
具有 xml 格式的值,因此我想使用 php 在我的代码中生成相同的值。
我尝试过 date('Y-m-dTH:i', time());
但它正在生成 2014-09-29EDT02:28:11
我希望生成2011-01-21T11:36:47.384。
请告诉我如何实现这一目标。
谢谢。
最佳答案
关于PHP 获取 XML 格式的日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26094064/