Home / Guides / Working with timestamps in databasesGuide

Every database has functions to convert a Unix timestamp to a date and back.

Choosing how to store it: an integer epoch is timezone-independent and simple to sort and compute on, which suits logs and events. A TIMESTAMP or DATETIME type, on the other hand, is human-readable and lets you use date functions directly. Most teams store an integer in UTC and convert to local time only at display time.

Try it in the converter
All guides