0

I have a String like that : Sun Jul 21 02:51:39 +0000 2013 i want to convert it to a date with PHP, it's possible ??

userHassan
  • 23
  • 1
  • 6

2 Answers2

0

do it like that:

$arr = date_parse("Sun Jul 21 02:51:39 +0000 2013");

after that you can do something like this:

$unixTimestamp = mktime($arr["hour"], $arr["minute"], $arr["second"], $arr["month"], $arr["day"], $arr["year"]); 
Tobias Bambullis
  • 736
  • 5
  • 17
  • 45
0

Or you can use strtotime also. http://php.net/strtotime It works for older php versions also.

Lajos Veres
  • 13,595
  • 7
  • 43
  • 56