Using the DateTime class, if I try to run the following code:
DateTime
$mydate = new DateTime(); echo $mydate->date;
I\'ll get back
The date property of DateTime is protected.
You can display the date with format function.
format("Y-m-d H:i:s")); } catch (Exception $e) { }
Or you can convert to array: