Search
 
SCRIPT & CODE EXAMPLE
 

PHP

convert one time zone datetime value to another using php

<?php
$date = new DateTime('2000-01-01', new DateTimeZone('Pacific/Nauru'));
echo $date->format('Y-m-d H:i:sP') . "
";

$date->setTimezone(new DateTimeZone('Pacific/Chatham'));
echo $date->format('Y-m-d H:i:sP') . "
";
?>
  
  2000-01-01 00:00:00+12:00
2000-01-01 01:45:00+13:45
Comment

PREVIOUS NEXT
Code Example
Php :: php delete all files in folder 
Php :: curl follow redirect php 
Php :: php artisan db:seed Call to undefined method AppModelsProduct::factory() 
Php :: wordpress get post thumbnail url 
Php :: php array remove empty values 
Php :: laravel table data types 
Php :: print all session variables php 
Php :: enqueue wordpress 
Php :: install zip php extension 
Php :: file delete in laravel 
Php :: laravel scout import command 
Php :: get current url in codeigniter 
Php :: php content type xml 
Php :: laravel storage check file exists 
Php :: wp get image alt 
Php :: php.ini settings 
Php :: laravel publish email template 
Php :: foreign key in laravel migration 
Php :: count object php 
Php :: full url php 
Php :: install php7.4 in linux server 
Php :: seconds to minutes php 
Php :: what php can do 
Php :: fopen(F:xampphtdocsEscubydustoragefonts//themify_normal_f60486608aadd4e36c92c9895f99838f.ufm): failed to open stream: No such file or directory 
Php :: php object check if property exists 
Php :: php get ip address 
Php :: php ip address of visitor 
Php :: localhost install new plugin ftp wp 
Php :: php decode html special characters 
Php :: get last inserted id in php 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =