Working with date attributes
The Collibra Platform uses Unix timestamps in milliseconds to store dates and time.
December 30, 2021 is 1640822400000
in Unix timestamp in milliseconds
When you interact with the Collibra Platform through an API, use the Unix timestamp in milliseconds to specify a date. In most cases, the date must be in UTC at midnight: hours, minutes, seconds and milliseconds set to 0
.
Use EpochConverter to convert to and from Unix timestamps and find conversion code snippets.
An example where a timestamp is required is updating the expiration date of an asset through the Core REST API v2. The following call sets the value of an expiration date attribute to June 30, 2020.
curl -X PATCH \ https://<your_dgc_environment_url>/rest/2.0/attributes/<your_attribute_uuid> \ -H 'Content-Type: application/json' \ -d '{ "value": "1593475200000" }'
Values that do not represent a UTC time at midnight are invalid and trigger a "Value not allowed" error.
In some cases, the API allows variations, for example, as of Collibra 5.7, the REST Import API v2 and Collibra Connect also support ISO 8601 dates in UTC at midnight for date attributes.