|
|
Tutorials » Php »
|
Topic |
What is a strtotime Function?
|
|
Explanation |
|
The "strtotime()" function is used to parse about any English textual datetime description into a Unix timestamp.
Syntax:
strtotime(time,now)
In the above syntax the "time" is a mandatory field, which specifies the string to parse, "now" is the optional field is a timestamp used to calculate the returned value, if left current time will be taken.
Example:
<?php
echo date('m/d/Y h:i:s', strtotime('next tuesday'));
?>
Result:
05/22/2012 12:00:00
In the above example the strtotime() function is used to return the date of next tuesday.
Note: PHP (5 >= 5.1.0)
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|