Today, yesterday, tomorrow in PHP
Here is how to get the date of today, testerday, tomorrow, etc. in PHP:
$today = date("Y-m-d");
# 2011-01-10
$yesterday = date("Y-m-d", mktime(0,0,0, date("m"), date("d")-1, date("Y")));
# 2011-01-09
$tomorrow = date("Y-m-d", mktime(0,0,0, date("m"), date("d")+1, date("Y")));
# 2011-01-11
For more info, check the documentation.
Comments (0)
Trackbacks (0)
Leave a comment
Trackback