Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

MYSQL Arredonde a data e hora para 15 minutos

SELECT NOW() x,FROM_UNIXTIME(FLOOR(UNIX_TIMESTAMP(NOW())/900)*900) y;
+---------------------+---------------------+
| x                   | y                   |
+---------------------+---------------------+
| 2013-10-10 09:50:20 | 2013-10-10 09:45:00 |
+---------------------+---------------------+