mysql current time with 0 seconds -


i want insert/update data table current time, want seconds 0, example, '2014-06-27 23:36:00'. how achieve this?

i think maketime() somehow involved, have no idea how.

curdate() + interval hour() hour + interval minute() minute unfortunately doesn't work, not surprising.

edit: final solution - date_format(curtime(), '%y-%m-%d %h:%i:00').

mysql> select date_format(current_timestamp(), '%y-%m-%d %h:%i:00') ts_zero_seconds; +---------------------+ | ts_zero_seconds     | +---------------------+ | 2014-06-27 02:06:00 | +---------------------+ 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -