获取服务器时间

Get server time 获取服务器时间

Time接口可以用来获取当前服务器时间。业务单元的时区设置将被应用.

当通过API管理多个业务单元,且他们分别使用不同的时区时,这可能会被用到。所有其他请求需要传递datetime参数的,都假设它们是在业务单元所设置的时区.

请求数据格式

请求 URL 参数:
参数 类型 描述
apiKey string 您的API key,为了认证身份。必填.

示例:

https://api.esv2.com/v2/Api/Time?apiKey=YOUR_API_KEY_HERE

应答

元素/属性 类型 描述
Data dateTime 目前服务器日期和时间*
*注意: Date/time 格式为 ISO-8601, 所用的XML 架构: http://www.w3.org/TR/xmlschema-2/#dateTime

示例

请求:
GET https://api.esv2.com/v2/Api/Time?apiKey=test_api_key1 HTTP/1.1

Accept-Encoding: gzip,deflate
Host: api.esv2.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
OK 应答:
 
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 24 Apr 2013 10:33:09 GMT
Content-Length: 173<ApiResponse
xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>

  <Data>2013-04-24T10:33:09.4338472Z</Data>
</ApiResponse>