Re: How to round a datetime field
Hi,
I think an easier way to do this would be:
select from_unixtime(round(unix_timestamp('2006-10-10 14:15:01')/(60*30))*(60*30));
select from_unixtime(round(unix_timestamp('2006-10-10 14:14:59')/(60*30))*(60*30));
You can of course replace 30 with any number of minutes you'd like to round to.
replacing ROUND with FLOOR might sometimes be useful as well.
Subject
Written By
Posted
December 20, 2006 09:04AM
December 20, 2006 10:07AM
December 20, 2006 10:14AM
December 20, 2006 10:31AM
Re: How to round a datetime field
March 17, 2008 05:33AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.