Palpal sandbox IPN returning datetime as Mon Jun 15 2015 12:04:00 GMT+0600 (Azores Standard Time)
. How to format this in PHP? Please look at my date format. This is not duplicate.
Asked
Active
Viewed 796 times
1

Rejoanul Alam
- 5,435
- 3
- 39
- 68
-
possible duplicate of [Convert one date format into another in PHP](http://stackoverflow.com/questions/2167916/convert-one-date-format-into-another-in-php) – Narendrasingh Sisodia Jun 15 '15 at 06:35
-
@Uchiha This is not duplicate. Please see first my returning format – Rejoanul Alam Jun 15 '15 at 06:37
1 Answers
2
If you remove (Azores Standard Time)
your date will become valid, and then you can use strtotime()
or DateTime
:
$string = 'Mon Jun 15 2015 12:04:00 GMT+0600 (Azores Standard Time)';
$string = substr($string, 0, strrpos($string, '(') - 1);
$dt = new DateTime($string);
echo $dt->format('c \o\r U');

Glavić
- 42,781
- 13
- 77
- 107