Thursday, November 11, 2010

Round up a mysql utc_timestamp to the next five minute block

Programmer Question

I need to find the next (minutes divisible by five):00 from from the result of obtaining the current time in UTC, let me explain...



I use the



SELECT UTC_TIMESTAMP()


Function in MySql, which returns me "2010-11-11 16:26:19".



I then want to convert this value to "2010-11-11 16:30:00", preferably using MySql only, or a combination of MySql and PHP.



Cheers!



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails