Date functions
| Function | mysql | postgre | oracle | Description |
|---|---|---|---|---|
| ADD_MONTHS(d, n) |
|
uses + or - |
|
Date d plus n months |
| LAST_DAY(d) | Last day of the month containing date d | |||
| MONTHS_BETWEEN(d, e) | x | x |
|
Months between dates d and e |
| NEXT_DAY(d, weekday) | The first weekday (mon, tue, etc.) after d | |||
| NEW_TIME(d, z1, z2) | Convert date/time d from time zone z1 to z2 | |||
| ROUND(d[, fmt]) |
|
|
|
d rounded on fmt (the default for fmt is midnight) |
| TRUNC(d[, fmt]) | d truncated on fmt (the default for fmt is midnight) | |||
| EXTRACT(c FROM d) |
|
|
|
Extract date/time component c from expression d |
| Sysdate | Returns the current operating system date from database server |