The SYSDATE() function returns the current date and time as a string YYYY-MM-DD hh:mm:ss or numerically as BIGINT YYYYMMDDhhmmss or as DECIMAL YYYYMMDDhhmmss.microseconds, depending on whether the function is used in string or numeric context.
The value is expressed in the format of the current session time zone.
The SYSDATE() function returns the exact time the function is executed.
In contrast, the NOW() function returns the time when execution of the statement started.
Inside routines and triggers, NOW() returns the time the routine started executing.
The "Precision" argument can be specified to indicate a sub-second precision from 0 to 6 digits.
The specification of "Precision" must be a written number from 0-6. Expressions or variables produce a syntax error, larger values produce a precision error.
Setting the system variable timestamp does not affect the SYSDATE() function. |