Date/Time Functions
This section has functions that deal with dates and times.
Date Constant
How is a date constant represented in code?
IBM DB2
DATE(<string as YYYY-MM-DD>)
MySQL
DATE(<string as YYYY-MM-DD> )
Strings of the form YYYY-MM-DD are interpreted as dates when a date is expected.
Oracle
DATE <string as YYYY-MM-DD>
Postgres
<string as YYYY-MM-DD>::DATE
The ::DATE converts the string to a date. Strings of the form YYYY-MM-DD are interpreted as dates when a date is expected.
SAS proc sql
<string as ddMmmyyyy>d
SQL Server
CAST(<string as YYYY-MM-DD> as DATE)
Strings of the form YYYY-MM-DD are also recognized as date constants for almost all settings. (There is one arcane internationalization setting where this is not true.)
Current Date and Time
What is the current date and time?
IBM DB2
CURRENT_DATE (for date), CURRENT_TIMESTAMP (for date/time)
MySQL
CURDATE()(for date), NOW() (for date/time)
Oracle
TRUNC(sysdate) (for date...