Function | Description | Standard |
dateadd(p,i,d) | Adds a time interval to the given datetime value d. p can be "year", "month", "day", "hour", "minute", or "second". i is the number of years/months/etc to add to the datetime value d (or, if negative, to subtract from the datetime value d). | Sybase/MSSQL. MySQL has a different parameter order. |
datediff(p,d1,d2) | Returns the difference between two date/time values (d2-d1), in terms of the units specified by p. p can be "year", "month", "day", "hour", "minute", or "second". | Sybase/MSSQL. MySQL uses timestampdiff(). |
datepart(p,d) | Returns one integer part of a datetime value d. p can be "year", "month", "day", "hour", "minute", or "second". Year values are always 4-digit. Month and Day values always start at 1; Hour, Minute, and Second values always start at 0. Hours are returned in 24-hour format (0 = midnight, 23 = 11pm). | Sybase/MSSQL. MySQL uses day(), month(), year(), etc. |
getdate() | Returns the current date/time value. | Sybase/MSSQL. MySQL uses now(). |