Accent Fields Datetime

Date

A day — and the UTC-midnight trap that prints yesterday.


A day: `2026-10-06`, produced by `date_picker` — the [Datetime](datetime.md) family's day-sized method, and the one a calendar site lives on.

Declaring one

Label Publish date
Key publish_date
Data type date
Editor date_picker

An example

<time datetime="<%= cms.asset.content.publish_date %>">
  <%= new Date(cms.asset.content.publish_date + 'T00:00')
        .toLocaleDateString('en-US', { dateStyle: 'long' }) %>
</time>

The + 'T00:00' is deliberate: a bare date handed to new Date() is parsed as UTC midnight, which prints as the previous evening west of Greenwich. Anchoring it to local midnight keeps the printed day the stored day — the one genuine trap in an otherwise plain field.

When another method fits better