date now php
snippet in php

date now php

user6473

date('Y-m-d H:i:s')

php date now

user3269


 <?php
echo "Today is " . date("Y/m/d") . "<br>";
echo "Today is " . date("Y.m.d") . "<br>";
echo "Today is " . date("Y-m-d") . "<br>";

 echo "Today is " . date("l");
?> 

php date now

user3157


 <?php
$d=mktime(11, 14, 54, 8, 12, 2014);
echo "Created date is " . date("Y-m-d h:i:sa", $d);
?> 

date now php

user9804

date("Y-m-d H:i:s");

how to set date in php

user1910

// 1. create a date instance
$date = new DateTime;

// 2. set the date using the setDate(year, month, date) method on the
//    $date instance
$date->setDate(1999,02,19);

date now php

user8087

echo date('c');

// 2015-07-27T00:00:00+02:00