php.js : strtotime() function
strtotime() function
The strtotime() function is used to convert an english datetime description (string) to a UNIX timestamp.
Version:
1103.1210
Syntax:
strtotime (dttime_string, ts_now)
Parameters:
Name | Description | Required / Optional | Type |
---|---|---|---|
dttime_string | The string to parse. | Required | String |
ts_now | The timestamp used to calculate the returned value. | Optional | Integer |
Example of php.js strtotime() function:
In the following web document strtotime() function returns unix timestamp.
<?php
echo strtotime('now').'<br>';
echo strtotime('10 January 2000').'<br>';
echo strtotime('+1 day').'<br>';
echo strtotime('+1 week').'<br>';
echo strtotime('+2 days 6 hours 2 seconds').'<br>';
echo strtotime('next Monday').'<br>';
echo strtotime('last Saturday').'<br>';
?>
View the example of php.js strtotime() function in the browser
Previous: php.js : strptime() function
Next:
php.js : time() function
- Weekly Trends
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
- JavaScript functions Exercises
- Python Tutorial
- Python Array Exercises
- SQL Cross Join
- C# Sharp Array Exercises
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook