<?php
date(format,timestamp)
l (Lowercase L) - Represents day of the week
d - Tells the day of the month
m - Tells the month of the year
Y - Represents a year
echo "Today is " . date("m/d/Y") . "<br>";
echo "Today is " . date("m.d.Y") . "<br>";
echo "Today is " . date("m-d-Y") . "<br>";
echo "Today is " . date("l");
H - 24-hour format of an hour (0 to 23)
h - 12-hour format of an hour (0 to 12)
i - Minute with leading zeros (0 to 59)
s - Seconds with leading zeros (0 to 59)
a - am or pm
echo "The time is " . date("h:i:sa");
echo "The time is " . date("H:i:s");
date_default_timezone_set("America/New_York");
mktime(hour, minute, second, month, day, year)
$d=mktime(01, 1, 1, 1, 01, 0001);
echo "Created date is " . date("Y-m-d h:i:sa", $d);
$d=strtotime("4:33am December 6 2011");
echo "Created date is " . date("Y-m-d h:i:sa", $d);
$d=strtotime("tomorrow");
echo date("Y-m-d h:i:sa", $d) . "<br>";
$d=strtotime("next Saturday");
echo date("Y-m-d h:i:sa", $d) . "<br>";
$d=strtotime("+3 Months");
echo date("Y-m-d h:i:sa", $d) . "<br>";
strtotime(time, now)
?>