How can I convert
2012-01-18T11:45:00+01:00
(ISO 8601) to 1326883500
(unixtimestamp) in PHP?
This code converts an ISO 8601 datetime to a Unix timestamp in UTC.
echo date("U",strtotime('2012-01-18T11:45:00+01:00'));
longer version:
$dateTime = new DateTime('2012-01-18T11:45:00+01:00');
$dateTime->setTimezone(new DateTimeZone('UTC'));
$utcTimestamp = $dateTime->getTimestamp();
echo $utcTimestamp;