asd - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of asd.php
- <?php
- $timezone = "EST";
- $date = explode("/", trim("02.07-02.07/2022/12:00:00/23:00:00"));
- $exxxxp = explode("-",$date[0]);
- $exxxxp[0] = str_replace(".", "-", $exxxxp[0]);
- $exxxxp[1] = str_replace(".", "-", $exxxxp[1]);
- $dattttt = $date[1]."-".$exxxxp[0]." ".$date[2];
- $dt = new DateTime($dattttt, new DateTimeZone($timezone));
- $dt->setTimezone(new DateTimeZone('Europe/Moscow'));
- echo $ddddd1 = $dt->format('Y-m-d H:i');
- $dattttt = $date[1]."-".$exxxxp[1]." ".$date[3];
- $dt = new DateTime($dattttt, new DateTimeZone($timezone));
- $dt->setTimezone(new DateTimeZone('Europe/Moscow'));
- $ddddd2 = $dt->format('Y-m-d H:i');
- $currentDateTime = new \DateTime(null, new \DateTimeZone('EST'));
- echo $currentTime = $currentDateTime->format('H:i:s');