Php дата и время создания из формата

Примеры кода

4
0

php дата и время создания

$date = DateTime::createFromFormat('d-m-Y', '15-12-2020');
1
0

форматирование даты sting php

# From a date Object:
date_format ( DateTimeInterface $object , string $format )

# From the current time
$dateTime = new \DateTime(); 
// or pass a string or int ->`DateTime($date_time)`
$dateTime->format('y-j-d H:i:s T'); #print ex: 21-2-02 16:00:01 PST

# Or a quick one-liner:
date('g:i A m-d-Y', strtotime($date_time)); #print ex: 2:00 PM 02-02-2021
0
0

string в php даты и времени

$s = '06/10/2011 19:00:02';
$date = strtotime($s);
echo date('d/M/Y H:i:s', $date);

Похожие страницы

Похожие страницы с примерами

На других языках

Эта страница на других языках

English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................