Answers for "new datetime php to string"

PHP
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
2

date to string php

$date_string_prepared = date_create("2020-08-07");
$date_string = $date_string_prepared->format("d M Y");
// result 07 Jul 2020
Posted by: Guest on August-29-2020

Browse Popular Code Answers by Language