How to use strtotime in PHP

This article describe about strtotime() Function in PHP.
  • 1710

strtotime() Function

Parsed English textual date/time into the Unix timestamp by using the strtotime() function.


strtotime(time, now)


Parameter Description
time Required. Define the time string for parse.
now Optional. Timestamp used to calculate the returned value. If omitted current date time used.


echo(strtotime("now") . "<br />");
echo(strtotime("3 October 2005") . "<br />");
echo(strtotime("+5 hours") . "<br />");
echo(strtotime("+1 week") . "<br />");
echo(strtotime("+1 week 3 days 7 hours 5 seconds") . "<br />");
echo(strtotime("next Monday") . "<br />");
echo(strtotime("last Sunday"));




You may also want to read these related articles Click here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.