The time in PHP has two formatting functions: Date () and gmdate (), which are described in the official document as follows:
Date-format a local time/date
Gmdate-format a gmt/UTC date/time and return the Greenwich Mean Time (GMT ).
For example, if
After finding the reason, I searched the internet for some time zone setting methods for PHP:
1, modify the php.ini, found in the php.ini Data.timezone = Remove the front of it, and then set data.timezone = "Asia/shanghai";
2. Use the function ini_
This article mainly introduces the difference between date and gmdate in PHP and the default time zone settings. For more information, see
I. What is the difference between date and gmdate?The PHP time function has two formatting functions: date ()
PHP has a series of date and time functions, which facilitates you to get time information that you can convert into the format you want and use to calculate or present to your users. But if you want to implement some complex functionality, things
Javascript+php the method of displaying local time based on the user's time zone
This article mainly introduces the javascript+php implementation of the local time according to the user time zone method, instance analysis JavaScript to obtain the
PHP default time zone is Europe and the United States, so with our Chinese time zone a full 8 hours, oh, let me introduce you to the PHP set time zone method, there is a need to know the friends can enter the reference.
In php.ini, the default is
Each region has its own local time. In online and radio communication, the time conversion problem is particularly prominent. The whole earth is divided into 24 time zones, each time zone has its own local time. For international radio or network
Now there is a cross-Time Zone application. users logging on to different time zones need to view their own time zones and switch between time zones.
My idea is that all the stored time in the system is GMT (UTC) time. When a user logs on, the
Javascript+php implements the method of displaying local time based on the user's time zone, JavaScript local
This article describes the Javascript+php implementation method that displays local time based on the user's time zone. Share to everyone
Each region has its own local time, in the Internet and radio communication, time conversion problem appears particularly prominent. The entire Earth is divided into 24 time zones, each with its own local time. In the case of international radio or
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.