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
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
convertir datetime a string en php
phpCopy$theDate = new DateTime('2020-03-08');
echo $stringDate = $theDate->format('Y-m-d H:i:s');
//output: 2020-03-08 00:00:00
pasar datetime a string php
$date = explode("/",date('d/m/Y/h/i/s')
list($day,$month,$year,$hour,$min,$sec) = $date);
echo $month.'/'.$day.'/'.$year.' '.$hour.':'.$min.':'.$sec;
//output: 03/08/2020 02:01:06
Convert DateTime to String in PHP
phpCopy$date = explode("/",date('d/m/Y/h/i/s')
list($day,$month,$year,$hour,$min,$sec) = $date);
echo $month.'/'.$day.'/'.$year.' '.$hour.':'.$min.':'.$sec;
//output: 03/08/2020 02:01:06
pasar datetime a string php
$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
pasar datetime a string php
$dateFormat = new DateTime(); // this will return current date
echo $stringDate = $date->format(DATE_ATOM);
//output: 2020-03-08T12:54:56+01:00
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us