Source Code:
(back to article)
<?php $timestamp = time(); // Use the current time, or replace with your own timestamp // Calculate the beginning of the day $beginning_of_day = strtotime("midnight", $timestamp); // Format and output the beginning of the day echo date("Y-m-d H:i:s", $beginning_of_day); // Output: [current year]-[current month]-[current day] 00:00:00 ?>
Result:
Report an issue