Home > Backend Development > PHP Problem > How to convert php utc time

How to convert php utc time

藏色散人
Release: 2023-03-13 13:26:01
Original
3761 people have browsed it

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;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template