<?php
// Everything you enter here will be executed by our servers. Try it!
//var_dump((new DateTime('1970-02-01 18:00:00', new DateTimeZone('Europe/Moscow')))->setTimezone(new DateTimeZone('UTC'))->format('Y-m-d\\TH:i:s\\Z'));
//var_dump((new DateTime('1970-02-01 18:00:00', new DateTimeZone('Europe/London')))->setTimezone(new DateTimeZone('UTC'))->format('Y-m-d\\TH:i:s\\Z'));
var_dump((new DateTime('1970-02-01 18:00:00', new DateTimeZone('Europe/London')))->setTimezone(new DateTimeZone('Z'))->format('Y-m-d\\TH:i:s\\Z'));
var_dump(new DateTime('1970-02-01T18:00:00Z'));
Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct(): Unknown or bad timezone (Z)' in /in/02XZs:7
Stack trace:
#0 /in/02XZs(7): DateTimeZone->__construct('Z')
#1 {main}
thrown in /in/02XZs on line 7
Process exited with code 255.