PHP strtotime() function
Complete PHP Date Reference
Definition and Usage
The strtotime() function parses an English textual date or time into a
Unix timestamp (the number of seconds since January 1 1970 00:00:00 GMT).
Syntax
| Parameter |
Description |
| time |
Required. Specifies the time string to parse |
| now |
Optional. Specifies the timestamp used to calculate the returned value. If
this parameter is omitted, current time is used |
Tips and Notes
Note: If the year is specified in a two-digit format,
values between 0-69 are mapped to 2000-2069 and values between 70-100 are mapped to 1970-2000.
Note: In PHP
5.1.0 this function returns false on failure (earlier versions returns -1).
Example
<?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"));
?>
|
The output of the code above could be:
1138614504
1128290400
1138632504
1139219304
1139503709
1139180400
1138489200
|
Complete PHP Date Reference
The Ektron Intranet
lets you do everything you need to do on your corporate intranet and everything you want to do... all with just one application.
What can you do with the Ektron Intranet? |

|
Navigate through content, documents, assets, colleagues and workgroups quickly and intuitively with enterprise search |

|
Communicate with friends and colleagues with forums, message boards and corporate blogging using the new Social Networking Platform |

|
Promote collaboration among coworkers in your organization through project workspaces where others can efficiently find information and work together |

|
Personalize your company profile by bookmarking and organizing favorite content, uploading assets, posting photos, blogging, and more |

|
Interact with features like tagging, flagging, wikis and ratings found in the Web 2.0 Toolbox |
 |
Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management |
|
|
|
|
See why there are 20,000+ Ektron integrations worldwide. Request an
INSTANT DEMO or download a
FREE TRIAL today. |
|