php get now date code example
Example 1: php get current year
$currentYear=date("Y");
Example 2: php get current date and time
$today = date("F j, Y, g:i a");
$today = date("D M j G:i:s T Y");
$today = date("Y-m-d H:i:s");
Example 3: date now php
date('Y-m-d H:i:s')
Example 4: php get day from date
$timestamp = strtotime('2009-10-22');
$day = date('D', $timestamp);
var_dump($day);
Example 5: php format date
<?php
$old_date_format = "20/03/1999";
$new_data_format = date("Y-m-d H:i:s", strtotime($old_date_format));
Example 6: date now php
date("Y-m-d H:i:s");