PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$firstdate = strtotime("1/1/2001 13:0:0"); //ex, this date is just taken from a DB so it could be anything
$currentdate = date("H:m:s");
$result = ???? in
$date1 = mktime(13, 0, 0, 1, 1, 2001);
$date2 = mktime(-48); // 48 hours ago
if ($date1 <= $date2) {
// date is at least 48 hours ago
} else {
// date is less than 48 hours ago
}
<?php
$date1 = mktime(13, 0, 0, 1, 1, 2001);
$date2 = mktime(date("H")-48); // 48 hours ago <--change
if ($date1 <= $date2) {
// date is at least 48 hours ago
} else {
// date is less than 48 hours ago
}
?>
any ideas? i think i have to get the current time, and subtract 48 hours from it, cuz when i use -48 alone it sends me one day back...
Stick with your way, someone will be able to tell me (hopefully since I'm having a brain fart) why my way didn't work as expected (didn't take me back exactly 48 hours either).