Home > Backend Development > PHP Problem > How to convert Beijing time to UTC in php

How to convert Beijing time to UTC in php

藏色散人
Release: 2023-03-08 08:36:01
Original
4038 people have browsed it

php Method to convert Beijing time to UTC: First create a PHP sample file; then pass "$time = timestamp-8*60*60;$startUtc = date('c',$time);" The statement can be used to convert Beijing time to UTC time.

How to convert Beijing time to UTC in php

#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.

php Beijing time to UTC time

The code is as follows:

$time = 时间戳-8*60*60;
$startUtc = date('c',$time );
Copy after login

[Recommended: PHP video tutorial]

The above is the detailed content of How to convert Beijing time to UTC in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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