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.



Your result can be seen below.

Result of php executing





Full code of asd.php

  1. <?php
  2.  
  3.         $timezone = "EST";
  4.  
  5.         $date = explode("/", trim("02.07-02.07/2022/12:00:00/23:00:00"));
  6.  
  7.         $exxxxp = explode("-",$date[0]);
  8.     
  9.  
  10.         $exxxxp[0] = str_replace(".", "-", $exxxxp[0]);
  11.         $exxxxp[1] = str_replace(".", "-", $exxxxp[1]);
  12.  
  13.         $dattttt = $date[1]."-".$exxxxp[0]." ".$date[2];
  14.  
  15.         $dt = new DateTime($dattttt, new DateTimeZone($timezone));
  16.         $dt->setTimezone(new DateTimeZone('Europe/Moscow'));
  17.         echo $ddddd1 = $dt->format('Y-m-d H:i');
  18.  
  19.         $dattttt = $date[1]."-".$exxxxp[1]." ".$date[3];
  20.         $dt = new DateTime($dattttt, new DateTimeZone($timezone));
  21.         $dt->setTimezone(new DateTimeZone('Europe/Moscow'));
  22.          $ddddd2 = $dt->format('Y-m-d H:i');
  23.          
  24.           $currentDateTime = new \DateTime(null, new \DateTimeZone('EST'));
  25.         echo $currentTime =  $currentDateTime->format('H:i:s');
  26.         
  27.         
  28.         
File Description
  • asd
  • PHP Code
  • 31 May-2023
  • 912 Bytes
You can Share it: