pasar datetime a string php

Solutions on MaxInterview for pasar datetime a string php by the best coders in the world

showing results for - "pasar datetime a string php"
Evann
01 May 2019
1$theDate    = new DateTime('2020-03-08');
2echo $stringDate = $theDate->format('Y-m-d H:i:s');
3
4//output: 2020-03-08 00:00:00
Alma
01 Sep 2016
1$date = explode("/",date('d/m/Y/h/i/s')
2list($day,$month,$year,$hour,$min,$sec) = $date);
3echo $month.'/'.$day.'/'.$year.' '.$hour.':'.$min.':'.$sec;
4
5//output: 03/08/2020 02:01:06
Emilia
21 Feb 2018
1$date = date_create_from_format('d M, Y', '08 Mar, 2020');
2echo $newFormat = date_format($date,"Y/m/d H:i:s");
3
4//output: 2020/03/08 00:00:00
Deshawn
02 Feb 2020
1$dateFormat = new DateTime(); // this will return current date
2echo $stringDate = $date->format(DATE_ATOM);
3
4//output: 2020-03-08T12:54:56+01:00