Skip to content

Creating DateTime Objects

DateTime objects can be created using different formats.

$date = new DateTime();
$date = new DateTime("2025-06-10");
$date = new DateTime("now", new DateTimeZone("UTC"));