This commit is contained in:
tianshujie
2021-10-21 16:55:55 +08:00
parent 759ab4c815
commit 760d533ccd
+6 -1
View File
@@ -504,7 +504,12 @@ class baseHelper
*/
static public function diffDate($date1, $date2)
{
return round((strtotime($date1) - strtotime($date2)) / 86400, 0);
/* Get the timestamp in the current operating system. */
$date1 = new DateTime($date1);
$date2 = new DateTime($date2);
$date1 = date_format($date1, "U");
$date2 = date_format($date2, "U");
return round(($date1 - $date2) / 86400, 0);
}
/**