SQL Date Formatter
Write a date literal for your database
One instant, rendered as a literal for PostgreSQL, MySQL, SQL Server, Oracle, SQLite, BigQuery and Snowflake — plus how each spells 'now' and how each reads a Unix timestamp.
Questions people ask
The things that come up about sql date formatters, answered plainly.
Should I store timestamps with or without a time zone?
With, nearly always — PostgreSQL's timestamptz, SQL Server's datetimeoffset. A timestamp without a zone is a wall-clock reading, and the moment two servers disagree about their zone, so does your data.
How do I convert a Unix timestamp in SQL?
It differs per engine: to_timestamp() in PostgreSQL, FROM_UNIXTIME() in MySQL, DATEADD(second, …, '1970-01-01') in SQL Server, TIMESTAMP_SECONDS() in BigQuery. The page gives all of them with your value substituted.
Related tools
Julian days, Excel serials, GPS time, cron expressions and format validators.