How to convert Greenwich Time to current time in php

藏色散人
Release: 2023-03-04 07:14:01
Original
3478 people have browsed it

php Greenwich Time conversion method: first define a PHP sample file; then enter the statement "$aa=strtotime("Greenwich Time")"; finally pass "echo date("Y- -m-d H:i:s",$aa)" method to obtain the conversion result.

How to convert Greenwich Time to current time in php

Recommendation: "PHP Video Tutorial"

Convert Green Reign Time to Current Time in PHP

$aa=strtotime("格林统治时间")
echo date("Y--m-d H:i:s",$aa)
Copy after login

Related introduction:

strtotime() function parses any English text date or time description into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 GMT).

Note: If the year representation uses a two-digit format, values ​​0-69 will be mapped to 2000-2069, and values ​​70-100 will be mapped to 1970-2000.

Note: Please note that for dates in m/d/y or d-m-y format, if the separator is a slash (/), the American m/d/y format is used. If the delimiter is a dash (-) or a dot (.), the European d-m-y format is used. To avoid potential errors, you should use YYYY-MM-DD format whenever possible or use the date_create_from_format() function.

date() function formats local date and time and returns the formatted date string.

The above is the detailed content of How to convert Greenwich Time to current time 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