Name
NOW( )
Synopsis
NOW( )
This function returns the current date and time. It will return the
date and time in a yyyy-mm-dd hh:mm:ss format,
but will return the data in a yyyymmdd format if
it’s used as part of a numeric calculation.
It’s synonymous with LOCALTIME()
.
SELECT NOW( ) AS Now, NOW( ) + 10000 AS 'Hour Later'; +---------------------+----------------+ | Now | Hour Later | +---------------------+----------------+ | 2005-01-12 17:10:28 | 20050112181028 | +---------------------+----------------+
By adding 10,000 to the current time, the hour is increased by 1 and the minutes and seconds by zero each, and the time is displayed in the second field, without dashes.
Get MySQL in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.