Mengembalikan tanggal dan waktu saat ini sebagai nilai dalam format 'YYYY-MM-DD hh:mm:ss' atau YYYYMMDDhhmmss, bergantung pada apakah fungsi tersebut digunakan dalam konteks string atau numerik. Nilainya dinyatakan dalam zona waktu sesi.
SELECT NOW();
'2007-12-15 23:50:26'
SELECT NOW() + 0;
20071215235026.000000
If the fsp argument is given to specify a fractional seconds precision from 0 to 6, the return value includes a fractional seconds part of that many digits.
SELECT NOW();
'2007-12-15 23:50:26'
SELECT NOW() + 0;
20071215235026.000000
NOW() returns a constant time that indicates the time at which the statement began to execute. (Within a stored function or trigger, NOW() returns the time at which the function or triggering statement began to execute.) This differs from the behavior for SYSDATE(), which returns the exact time at which it executes.
SELECT NOW(), SLEEP(2), NOW();
+---------------------+----------+---------------------+
| NOW() | SLEEP(2) | NOW() |
+---------------------+----------+---------------------+
| 2006-04-12 13:47:36 | 0 | 2006-04-12 13:47:36 |
+---------------------+----------+---------------------+
SELECT SYSDATE(), SLEEP(2), SYSDATE();
+---------------------+----------+---------------------+
| SYSDATE() | SLEEP(2) | SYSDATE() |
+---------------------+----------+---------------------+
| 2006-04-12 13:47:44 | 0 | 2006-04-12 13:47:46 |
+---------------------+----------+---------------------+