views:

400

answers:

1

Hello !

How to convert a date string Mon, 24 May 2010 17:54:00 GMT from RSS feed to a timestamp in PHP ?

+2  A: 

You can use the built-in function strtotime(). It takes a date string as its first argument and returns a Unix timestamp.

http://php.net/manual/en/function.strtotime.php

Geoff Adams
It looks like strtotime give strange results when the string contains the timezone. For example with "Sat, 21 Sep 2010 00:00 GMT" I get 1285372800 (25-09-2010)
Ilian Iliev