PHP
For example, today is November 2, 2102, so what does PHP do to get the timestamp of November 2, 2102?
Code: Echostrtotime (Date (' y-m-d ')), '
';
Get the time stamp tomorrow morning.
Code: Echostrtotime (Date (' y-m-d ', Strtotime (' +1 Day ')), '
';
Attach the test code:
echo strtotime (' 2012-11-2 '), '
';
echo strtotime (' 2012-11-2 00:00:00 '), '
';
Echo strtotime (Date (' y-m-d ')), '
';
echo Date (' y-m-d h:i:s ', Strtotime (date (' y-m-d ')), '
';
Echo strtotime (Date (' y-m-d ', Strtotime (' +1 Day ')), '
';
Echo (Strtotime (Date (' y-m-d ', Strtotime (' +1 Day)))-strtotime (date (' y-m-d '))/3600;
Date_default_timezone_set('PRC'); //Default time zoneEcho"Today:",Date("y-m-d", Time()),"
"; Echo"Today:",Date("y-m-d",Strtotime("June")),"
"; Echo"yesterday:",Date("y-m-d",Strtotime("-1 Day")), "
"; Echo"Tomorrow:",Date("y-m-d",Strtotime("+1 Day")), "
"; Echo"after a week:",Date("y-m-d",Strtotime("+1 Week")), "
"; Echo"2 days a week, four hours, two seconds later:",Date("y-m-d g:h:s",Strtotime("+1 Week 2 days 4 hours 2 seconds")), "
"; Echo"next week four:",Date("y-m-d",Strtotime("next Thursday")), "
"; Echo"Last Monday:".Date("y-m-d",Strtotime("Last Monday"))."
"; Echo"one months ago:".Date("y-m-d",Strtotime("Last month"))."
"; Echo"after one months:".Date("y-m-d",Strtotime("+1 Month"))."
"; Echo"ten years later:".Date("y-m-d",Strtotime("+10 Year"))."
";
The above describes the PHP to get yesterday today's time tomorrow, including aspects of the content, I hope the PHP tutorial interested in a friend helpful.