“Convertir fecha en PHP” Código de respuesta

formato de fecha de cambio de php

To convert the date-time format PHP provides strtotime() and date() function. We change the date format from one format to another.

Change YYYY-MM-DD to DD-MM-YYYY
<? php.
$currDate = "2020-04-18";
$changeDate = date("d-m-Y", strtotime($currDate));
echo "Changed date format is: ". $changeDate. " (MM-DD-YYYY)";
?>
Ankur

PHP Convertir la cadena hasta la fecha

$time = strtotime('10/16/2003');

$newformat = date('Y-m-d',$time);

echo $newformat;
// 2003-10-16
Sal-versij

cadena PHP hasta la fecha

$s = '06/10/2011 19:00:02';
$date = strtotime($s);
echo date('d/M/Y H:i:s', $date);
The above one is the one of the example of converting a string to date.
echo $s ->format('Y-m-d');
The above one is another method 
Filthy Fly

convertir cadena hasta la fecha php

$s = '08/11/2010 19:37:02';
$date = strtotime($s);
echo date('Y-m-d H:i:s', $date);
Zidane (Vi Ly - VietNam)

Convertir fecha en PHP

$originalDate = "2010-03-21";
$newDate = date("d-m-Y", strtotime($originalDate));
Selfish Sable

Convertir fecha php

$var = '21/05/2012';
$date = str_replace('/', '-', $var);
echo date('Y-m-d', strtotime($date))
Indonesia People

Respuestas similares a “Convertir fecha en PHP”

Preguntas similares a “Convertir fecha en PHP”

Más respuestas relacionadas con “Convertir fecha en PHP” en PHP

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código