Date-Only Values vs. Timestamps
A date-only value names a calendar day. A timestamp identifies an instant. Converting between them requires a time and time-zone decision.
Two different questions
A birthday such as 4 May is usually observed as a calendar date. It does not describe one instant shared by everyone on Earth. A transaction at a particular second, on the other hand, happened at a specific moment that can be shown differently in different regions.
These are different data types, even when both are displayed in a calendar. A date-only value answers “which day?” An instant answers “when on the shared timeline?” A local appointment combines a date and clock time with the zone rules needed to resolve it to an instant.
The midnight UTC trap
Suppose an application represents the date 2026-05-04 as midnight UTC. In a region behind UTC, that instant can be displayed on 3 May. The conversion has not changed the instant, but it has changed the visible date, which can be wrong for a birthday or all-day holiday.
The safer model is to preserve the date components as a date-only value until an instant is genuinely needed. If a business process requires a cutoff time, explicitly define the time, the named zone and how ambiguous or missing local times are resolved.
Deadlines and all-day events
A deadline described only as “4 May” may depend on a jurisdiction, organization or contract. It might mean the end of the local calendar day, an office closing time, or another specified cutoff. Do not invent a universal midnight convention for legal or financial use.
All-day calendar events also need clear start and end conventions. Software often uses an inclusive start date and an exclusive end date to represent a range of whole days. See inclusive date ranges for why endpoints matter.
APIs and databases
Use a date field or an unambiguous date string when the intended value is only a date. Use a timestamp or date-time with an explicit offset when an exact instant is required. For a future local event, include the zone identifier and original local intent as well.
Programming libraries may interpret date-only strings differently from date-time strings without an offset. Check the platform's parsing rules and test in both positive and negative UTC offsets. The JavaScript date guide explains one important example.
A selection checklist
Ask whether two people in different zones should see the same calendar date or the same instant. Ask whether a clock time and a zone are part of the original request. If the value repeats, record the recurrence rule separately. These questions usually reveal the right representation.
Explore calendar dates, Unix timestamps and database date storage for related decisions.