“Konwertuj datę w PHP” Kod odpowiedzi

Format daty zmiany 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 Conwert Ciąg na datę

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

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

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

Do tej pory ciąg php

$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

Konwertuj ciąg na datę php

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

Konwertuj datę w PHP

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

Konwertuj datę PHP

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

Odpowiedzi podobne do “Konwertuj datę w PHP”

Pytania podobne do “Konwertuj datę w PHP”

Więcej pokrewnych odpowiedzi na “Konwertuj datę w PHP” w PHP

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu