Home  >  Article  >  Backend Development  >  How to convert php utc time

How to convert php utc time

藏色散人
藏色散人Original
2021-10-25 10:31:043681browse

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.

How to convert php utc 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(&#39;Asia/Shanghai&#39;);
$b = date(&#39;Y-m-s H:i:s&#39;,strtotime(&#39;2019-01-09T18:19:39+08:00&#39;));
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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn