How PHP gets the localization time
local time zone identifier
$timezone _identifier = "Asia/hong_kong";
Set the local default time zone for all date-time functions in a script
Date_default_timezone_set ($timezone _identifier);
$aToday = getdate ();
This can be achieved by the date time of the region because the default is GMT 0 time zone
You can also set the php.ini [Date] ; Defines the default timezone used by the date functions Date.timezone ="Asia/hong_kong"
Restart Apache
$aToday = getdate ();
This can be achieved in the region date time I use the time () and the GETDATE () function to get different times and system time, consult the master, my Code is as follows:
The input reads:
1142992778
2006-3-22 1:59:38 int time (void)
is to return the current timestamp, that is, from January 1, 1970 00:00:00 to the current number of seconds
The array getdate (Int[timestamp]) is based on the date and time returned by timestamp
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.