Answers for "convert a date into string in php"

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
0

Convert DateTime to String in PHP

phpCopy$date = date_create_from_format('d M, Y', '08 Mar, 2020');
echo $newFormat = date_format($date,"Y/m/d H:i:s");

//output: 2020/03/08 00:00:00
Posted by: Guest on April-23-2021

Code answers related to "convert a date into string in php"

Browse Popular Code Answers by Language