Jump to content

Select record closest to this time yesterday


moto51

Recommended Posts

Solved it, used PHP as I had to use it anyway.

 

function minutes_round ($hour, $minutes = '5', $format = "H:i")
{
    $seconds = strtotime($hour);
    $rounded = round($seconds / ($minutes * 60)) * ($minutes * 60);
    return date($format, $rounded);
}


$yesterdayDate = date("Y-m-d", mktime(0, 0, 0, date("m"),date("d")-1,date("Y")));
$time = date( 'H:i:s');

$time = minutes_round($time);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.