我正在尝试将XML数据解析为数组,但问题是日期是如下所示的int类型。
<xml xmlns:s='uuid:RTYUI1-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:DFR12345-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly'>
<s:AttributeType name='AdmissionDate' rs:number='1' rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true'/>
</s:AttributeType>
<s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>
<rs:data>
<z:row AdmissionDate='42569'/>
</rs:data>
我从这里使用xmlPasser.class.php类,输出如下:
[rs:data] => Array
(
[z:row] => Array
(
[0] => Array
(
)
[1] => Array
(
)
[0_attr] => Array
(
[AdmissionDate] => 42569
)
...
答案 0 :(得分:1)
Excel将日期保存为1900年1月1日之后的天数
$days = 42569;
$d = new DateTime('1900-01-01');
echo $d->modify("+$days day")->format('r'); // Wed, 20 Jul 2016 00:00:00 +0000