Jump to content

comparing time in if statement


cloudll

Recommended Posts

if the time in the database is a timestamp you can do this

 

<?php
$st = $row['time'] + (15*60); // database time plus 15 mins
$t = time(); // current time
if ($t >= $st) {
  // do this
} else {
  // do this
}
?>

// if you want exactly 15min change >= to ==

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.