Convert ISO 8601 to unixtimestamp
问题 How can I convert 2012-01-18T11:45:00+01:00 (ISO 8601) to 1326883500 (unixtimestamp) in PHP? 回答1: echo date("U",strtotime('2012-01-18T11:45:00+01:00')); 回答2: To convert from ISO 8601 to unixtimestamp : strtotime('2012-01-18T11:45:00+01:00'); // Output : 1326883500 To convert from unixtimestamp to ISO 8601 (timezone server) : date_format(date_timestamp_set(new DateTime(), 1326883500), 'c'); // Output : 2012-01-18T11:45:00+01:00 To convert from unixtimestamp to ISO 8601 (GMT) : date_format(date