SQL Date and Time Functions Across Dialects
By Sharon Ben-Moshe · August 8, 2026 · 2 min read
Sharon Ben-Moshe is the founder of sqlfmt, a browser-based SQL formatter and validator with misspelled-keyword suggestions across PostgreSQL, MySQL, SQLite, SQL Server, and BigQuery.
“Add 7 days” is DATEADD in SQL Server, DATE_ADD in MySQL and BigQuery, a raw interval in PostgreSQL, and a modifier string in SQLite — the same operation, four unrelated shapes. Here's the working syntax for each dialect's core date functions.
Quick answer
Adding or subtracting time uses INTERVAL arithmetic in PostgreSQL, DATE_ADD()/DATE_SUB() in MySQL and BigQuery, DATEADD() in SQL Server, and date('now', modifier) strings in SQLite — five dialects, five unrelated syntaxes for the same three operations: add or subtract an interval, get the current date, and compute the difference between two dates.