How to use strtotime in PHP
This article describe about strtotime() Function in PHP.
strtotime() Function
Parsed English textual date/time into the Unix timestamp by using the strtotime() function.
Syntax
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. |
Example
<html>
<body>
<?php
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"));
?>
</body>
</html> |
Output

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