Convert String To date in PHP

streetparade picture streetparade · Feb 8, 2010 · Viewed 174.8k times · Source

How can I convert this string 05/Feb/2010:14:00:01 to unixtime ?

Answer

Sarfraz picture Sarfraz · Feb 8, 2010

Use the strtotime function:

Example:

 $date = "25 december 2009";
 $my_date = date('m/d/y', strtotime($date));
 echo $my_date;