Quick

Cross-Dialect Date/Time Function Reference

Find the correct date and time syntax for MySQL, PostgreSQL, SQL Server, SQLite and Oracle, side by side.

OperationMySQLPostgreSQLSQL ServerSQLiteOracle
Advertisement

About this tool

Date and time handling is one of the least portable corners of SQL — every engine names its functions differently and some (like SQLite) represent dates as text/numbers rather than a dedicated type. This reference lists the real, documented syntax for common operations in five widely used dialects so you can look up the equivalent instead of guessing. SQLite has no native date type: dates are stored as TEXT (ISO8601), REAL (Julian day) or INTEGER (Unix time), and its date functions operate on whichever representation you give them. Oracle's DATE type always includes a time component down to the second; use TIMESTAMP for sub-second precision.

The filter searches function names as well as descriptions, so typing datediff or strftime shows every row that uses it, alongside the equivalents in the other databases. Look out for the comments in some cells: day-of-week numbering differs (MySQL's DAYOFWEEK starts at 1 for Sunday, PostgreSQL's ISODOW at 1 for Monday), and SQL Server and Oracle depend on session settings. The table also covers Unix timestamps, time zone conversion and ISO week numbers.