The Complete Guide to Dates and Times for Developers
Dates and times are deceptively hard: time zones shift, formats disagree, and a timestamp means nothing without knowing how it's counted. This guide lays out how computers actually represent time, so you can store, compare, and display it without the usual bugs.
Prefer a focused read? Jump to What Is Unix Time? for epoch timestamps, ISO 8601 & UTC for formats and time zones, How to Convert Unix Timestamps to convert one, or How to Read a Cron Expression for scheduling.
An instant vs a wall-clock time
The single most useful distinction: an instant is a precise moment on a universal timeline, while a wall-clock time ("3:00 PM on August 28") depends on where you are. The same instant is a different wall-clock time in London and Tokyo. Store instants; convert to wall-clock only when you display.
How computers store time: the epoch
Most systems represent an instant as a Unix timestamp — the number of seconds (or milliseconds) since midnight UTC on 1 January 1970, the "epoch." It's a single number with no time zone, which makes it ideal for storing and comparing. See What Is Unix Time? for why it's counted this way and the looming Year 2038 problem.
UTC and time zones
UTC (Coordinated Universal Time) is the reference everyone agrees on; local times are offsets from it (UTC+05:30, UTC-08:00). The golden rule:
Store and compute in UTC; convert to the user's local zone only for display.
Doing math in local time invites bugs around daylight saving, when a zone's offset changes twice a year. Learn the details in ISO 8601 & UTC Explained.
Writing dates: ISO 8601
When you need a text representation, use ISO 8601 — 2026-08-28T14:30:00Z. It's unambiguous, sorts correctly as plain text, and is parseable everywhere. Avoid locale formats like 08/28/26, which mean different things in different countries. The Z means UTC; an offset like +05:30 names a specific zone.
Scheduling: cron
For "run this every weekday at 9am," the standard is a cron expression — five fields for minute, hour, day, month, and weekday. See How to Read a Cron Expression, or decode one in the Cron Parser.
Related
Convert an epoch value with the Unix Timestamp Converter or decode a schedule with the Cron Expression Parser — both client-side, nothing uploaded.
Try it
Paste a timestamp or a date to see it in UTC, ISO 8601, and your local zone at once — right in your browser.