Home > Article > Backend Development > How to convert php utc time
php UTC time conversion method: 1. Create a PHP sample file; 2. Pass "date('Y-m-s H:i:s',strtotime('2019-01-09T18:19:39 08 :00'));" method to convert UTC time into formatted time.
The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer
How to convert php utc time?
php Convert UTC time to formatted time
The code is as follows:
<?php date_default_timezone_set('Asia/Shanghai'); $b = date('Y-m-s H:i:s',strtotime('2019-01-09T18:19:39+08:00')); echo $b;
Recommended study: "PHP Video Tutorial"
The above is the detailed content of How to convert php utc time. For more information, please follow other related articles on the PHP Chinese website!