Date fields in the Bamboo REST API
Asked by Chandan Datta:

What is definition of the date fields in the REST API [link](https://docs.atlassian.com/atlassian-bamboo/REST/6.10.4/#d2e1911), because the one returned by the API for example the startedDate is not the same as in the [XSD](https://docs.atlassian.com/atlassian-bamboo/REST/6.10.4/xsd0.xsd) (xs:dateTime)

![Screen Shot 2020-02-26 at 2.45.33 PM.jpg](/t5/image/serverpage/image-id/84420i928A13A42687C630/image-size/large?v=v2&px=999 "Screen Shot 2020-02-26 at 2.45.33 PM.jpg")


Answers:
author: Ellie Z _they_them_
body: Hi Chattan,

Thank you for reaching out to the Atlassian Community!

I appreciate you calling out the discrepancy between the API documentation and the API results.

This REST API does not have an XML result, so the XSD would not be applicable here. That being said, however, the nodes with type="xs:dateTime" in the XSD for these endpoints (example below) are Unix timestamps in milliseconds.  

```
<xs:complexType name="restDeploymentResult">
```

\<xs:sequence\>  
\<xs:element name="deploymentVersion" type="restDeploymentVersion" minOccurs="0"/\>  
\<xs:element name="deploymentVersionName" type="xs:string" minOccurs="0"/\>  
\<xs:element name="id" type="xs:long"/\>  
\<xs:element name="deploymentState" type="buildState" minOccurs="0"/\>  
\<xs:element name="lifeCycleState" type="lifeCycleState" minOccurs="0"/\>  
\<xs:element name="startedDate" type="xs:dateTime" minOccurs="0"/\>  
\<xs:element name="queuedDate" type="xs:dateTime" minOccurs="0"/\>  
\<xs:element name="executedDate" type="xs:dateTime" minOccurs="0"/\>  
\<xs:element name="finishedDate" type="xs:dateTime" minOccurs="0"/\>  
\<xs:element name="reasonSummary" type="xs:string" minOccurs="0"/\>  
\<xs:element name="key" type="restDeploymentResultKey" minOccurs="0"/\>  
\<xs:element name="agent" type="restBuildAgent" minOccurs="0"/\>  
\<xs:element ref="operations" minOccurs="0"/\>  
\</xs:sequence\>

```
</xs:complexType>

<xs:complexType?name="restDeploymentVersion">
  <xs:sequence>
    <xs:element?name="id"?type="xs:long"/>
    <xs:element?name="name"?type="xs:string"?minOccurs="0"/>
    <xs:element?name="creationDate"?type="xs:dateTime"?minOccurs="0"/>
    <xs:element?name="creatorUserName"?type="xs:string"?minOccurs="0"/>
    <xs:element?name="items"?type="restDeploymentVersionItem"?minOccurs="0"?maxOccurs="unbounded"/>
    <xs:element?name="versionStatus"?type="restDeploymentVersionStatus"?minOccurs="0"/>
    <xs:element?ref="operations"?minOccurs="0"/>
    <xs:element?name="creatorDisplayName"?type="xs:string"?minOccurs="0"/>
    <xs:element?name="creatorGravatarUrl"?type="xs:string"?minOccurs="0"/>
    <xs:element?name="planBranchName"?type="xs:string"?minOccurs="0"/>
    <xs:element?name="ageZeroPoint"?type="xs:dateTime"?minOccurs="0"/>
  </xs:sequence>
</xs:complexType>

<xs:complexType?name="restDeploymentVersionItem"?abstract="true">
  <xs:sequence>
    <xs:element?name="id"?type="xs:long"/>
    <xs:element?name="name"?type="xs:string"?minOccurs="0"/>
  </xs:sequence>
</xs:complexType>
```

For example the startedDate in your screenshot --

```
startedDate: 1582171641497,
```

this translates as:

* **Timestamp in milliseconds**: 1582171641497
* **GMT** : Thursday, February 20, 2020 4:07:21.497 AM
* **Unix Epoch**: 1582171641
* **GMT** : Thursday, February 20, 2020 4:07:21 AM

Please do not hesitate to reach out if you have any additional questions!

Cheers,

Elias \| Bamboo Support

comments: author: Chandan Datta
body: Thanks Elias