Skip to content

Commit

Permalink
Fix date
Browse files Browse the repository at this point in the history
  • Loading branch information
lennyrouanet committed Mar 19, 2024
1 parent d5ebead commit 797be88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion component/Time/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(

$time = is_string($date) ? strtotime($date) : $date;

if (!is_a($this, DateTime::class)) {
if (!is_a($this, DateTime::class) && $time) {
$time = (new \DateTime())->setTimestamp($time)->setTime(0, 0)->getTimestamp();
}

Expand Down

0 comments on commit 797be88

Please sign in to comment.