in reply to Problem with s///

Somewhat unrelated to your question, but here is a example to get the seconds straight before they reach localtime.
$time_str = localtime( int(time / 60) * 60);
Boris