无法解析日期时间类型

时间:2016-04-07 07:49:03

标签: php datetime soap

我想用soap客户端调用bluedart pincode master api,但在传递参数后会出错

请求参数 -

$params = array(
            'lastSynchDate' => '06-04-2016',
            'Profile' =>
                array(
                    'Api_type' => 'S',
                    'LicenceKey'=>$licencekey,
                    'LoginID'=>$loginid,
                    'Version'=>'1.3'
                )
        );

回复错误 -

The formatter threw an exception while trying to deserialize the message:

There was an error while trying to deserialize parameter http://tempuri.org/:lastSynchDate.
The InnerException message was 'There was an error deserializing the object of type System.DateTime.
The value '06-04-2016' cannot be parsed as the type 'DateTime'

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

虽然我从未使用bluedart pincode master api,但我确信这是因为日期不是标准YYYY-MM-DD格式。

而不是

06-04-2016

尝试

2016-06-04