How do I round a timestamp to the last minute?
I assume you are wanting to round based ont he number of seconds? If that's the case, ar you always rounding up? Always rounding down? Does the rounding depend on the number fo seconds? Need more details on exactly what you are trying to do.
I want to round down to zero seconds that way I can compare against my database
thanks
How is it being stored in your DB? What format are you trying to make comparisons to?
again,
all I want to do is round a time stamp down to the last minute.
///Example
if a time stamp is 1010342461 -> January 6th 2002, 18:41:01
I want to round down to the last minute wich is 1010342460 -> January 6th 2002, 18:41:00
[man]date[/man] [man]strtotime[/man]
that does not tell me anything
use date to get the current time without the seconds then use strtotime to convert that date back into a timestamp. Bonus points for thinking for yourself.
$t="1010342461"; $timetominute=floor($t/60)*60;