PHP 日期函数 date_timezone_get()


PHP 日期函数 date_timezone_get()

<?php
   $dateSrc = '2007-04-19 12:50 GMT';
   $dateTime = date_create( $dateSrc);;
   $DateTimeZone = date_timezone_get ( $dateTime );

   echo 'Return timeZone is '. timezone_name_get ($DateTimeZone);
   echo "\n";

   # Using second function.
   $dateTime = new DateTime($dateSrc);
   $DateTimeZone = $dateTime->getTimezone ();

   echo 'Return timeZone is '. timezone_name_get ($DateTimeZone);
?>