fork download
  1. <?php
  2.  
  3. // your code goes here
  4. $date = new \Datetime('2021-01-02');
  5. var_dump($date);
Success #stdin #stdout 0.03s 26176KB
stdin
Standard input is empty
stdout
object(DateTime)#1 (3) {
  ["date"]=>
  string(26) "2021-01-02 00:00:00.000000"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(3) "UTC"
}