php date time date code example
Example 1: php get day from date
$timestamp = strtotime('2009-10-22');
$day = date('D', $timestamp);
var_dump($day);
Example 2: php get current time and date
date("Y-n-j G:i:s");
//-->2020-10-29 23:27:15
$timestamp = strtotime('2009-10-22');
$day = date('D', $timestamp);
var_dump($day);
date("Y-n-j G:i:s");
//-->2020-10-29 23:27:15