Include milliseconds in date serialization
We've added an opt-in configuration option to include milliseconds in date serialization across both the Content Delivery API (CDA) and Content Management API (CMA).
The problem
Until now, DatoCMS APIs serialized dates without milliseconds (e.g., 2025-12-05T00:01:00-05:00), even though the underlying data stores full millisecond precision.
When customers sort records by date, items with the same timestamp (when rounded to seconds) appear out of order. This looks like a sorting bug, but it's actually correct behavior—the records have different millisecond values that simply aren't visible in the API response.
What's new
You can now opt-in to include milliseconds in date serialization. Once enabled, both APIs return full precision:
GraphQL CDA:
{ allBlogPosts(orderBy: createdAt_DESC) { createdAt # Returns "2025-12-05T14:30:00.345+00:00" }}REST CMA:
{ "data": { "attributes": { "created_at": "2025-12-05T14:30:00.345+00:00" } }}This allows you to see the full precision of date fields, makes sorting behavior transparent and predictable, and ensures consistent date formats across both APIs.
How to enable it
The change is opt-in at the project level to ensure backward compatibility. Navigate to Configuration / Available Updates and enable the "Include milliseconds in date serialization" option.