Co Worker
0
Q:

datetime php

$date = DateTime::createFromFormat('d-m-Y', '15-12-2020');
2
/**
 * Its always best to use a datetime object
 */
$dateTime = new \DateTime();
/**
 * You can get the string by using format
 */
$dateTime->format('Y-m-d H:i:s');
6
$dateTime = new \DateTime();
$dateTime->format('Y-m-d H:i:s');
2

New to Communities?

Join the community