Answers for "DateTime to string en php"

PHP
2

pasar datetime a string php

$theDate    = new DateTime('2020-03-08');
echo $stringDate = $theDate->format('Y-m-d H:i:s');

//output: 2020-03-08 00:00:00
Posted by: Guest on March-27-2021
2

Datetime to string php

<?php
$date = new DateTime('2000-01-01');
echo $date->format('Y-m-d H:i:s');
?>
Posted by: Guest on March-30-2020

Browse Popular Code Answers by Language