NYCPHP Meetup

NYPHP.org

[nycphp-talk] rounding time values to the nearest hour

Allen Shaw ashaw at polymerdb.org
Tue Apr 29 13:58:13 EDT 2008


Hi Gang,

Anyone have a handy way to round time values to the nearest hour? 

I've got time values stored in the database (MySQL) and often need to 
group them by the hour (e.g., times between 09:30 and 10:29 get grouped 
under 10:00).  Up to now I've been splitting on the colon and figuring 
it out based on the separate hour and minute values, but I thought there 
might be a better way...

Thanks,
Allen

-- 
Allen Shaw
slidePresenter (http://slides.sourceforge.net)




More information about the talk mailing list