View Single Post
  #24 (permalink)  
Old 10-16-2007, 04:09 AM
vims vims is offline
D-Web Programmer
 
Join Date: Oct 2007
Posts: 67
vims is on a distinguished road
Post Re: string functions and manipulations in php

Today, we are going to discuss about the strtotime()
Strtotime() - Parse about any English textual datetime description into a Unix timestamp

Syntax
int strtotime ( string time [, int now] )
The function expects to be given a string containing an English date format and will try to parse that format into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 GMT), relative to the timestamp given in now, or the current time if none is supplied. Upon failure, -1 is returned.

Example:
echo strtotime("now")
Output: 1192529546

echo date('l, F jS Y', strtotime("third wednesday", strtotime("2007-10-01"))) . "<br>";
Output: Wednesday, October 17th 2007

echo date('l, F jS Y', strtotime("third sunday", strtotime("2007-10-01")));
Output: Sunday, October 21st 2007
Reply With Quote