The DateTime Field stores both a date and time value within the property, value
.
{
"Signature Timestamp": {
"displayValue": "4/13/2015 9:20 AM",
"value": "2015-04-13T09:20:00Z",
"id": "83fc55d4-274b-4b97-a56c-a479010b6faa",
"name": "Signature Timestamp",
"type": "DateTime"
}
}
NOTE:
The id, name, and type are not necessary when creating or updating a form, they are returned in the
JSON
of a request for readability.
Value
The value
property of the Date Field expects the date in the ISO 8601 format and more specifically in UTC.
The expected format takes the following form, YYYY-MM-DDThh:mm:ssZ, where:
Format | Description |
---|---|
YYYY | A four-digit year, 0000 through 9999. |
MM | A two-digit month of the year, 01 through 12. |
DD | A two-digit day of that month, 01 through 31. |
hh | Zero-padded hour between 00 and 23 |
mm | A zero-padded minute between 00 and 59 |
ss | A zero-padded second between 00 and 60 (where 60 is only used to denote an added leap second). |
As an example, to set a DateTime Field to 1:30:25 PM on April 27th, 2015 the following format would be used:
{
"value": "2015-04-27T13:30:25Z"
}
Display Value
The displayValue
property of a DateTime Field is read-only. This means any change to this property will not be persisted after initially setting or updating a DateTime Field.
The displayValue
property presents the value
property as a formatted string
which is defined by the template rules.