Question 1: Is time () always the timestamp of the current time zone obtained by time? Whether or not the time zone is set. PHPcode // I wrote two test pages. The two pages get the same value: //. php: echotime (); // B. phpdate_defa
1. is time () always the timestamp of the current time zone? Whether or not the time zone is set.
PHP code
// I wrote two test pages. The two pages get the same value: //. php: echo time (); // B. phpdate_default_timezone_set ('prc'); echo time ();
2. at which time does the time () method obtain the timestamp?
For example, in WINDOWS, do I refer to WINDOWS Time in the toolbar? Then subtract 8*60*60?
In Linux, does it refer to the hardware clock or the software clock?
3. does php4 not support time zone setting?
Our unit server is configured with php4, and then directly "echo date ('Y-m-d H: I: s');" without setting the time zone ');", the output is also the correct Chinese time.
Thank you!
------ Solution --------------------
Of course.
I took a closer look at your original question.
Echo time ();
Date_default_timezone_set ('prc ');
Echo time ();
If the output result is the same, do you have any questions?
There is a conflict in my #1 reply. time always gets Greenwich Mean time.
The date function is related to the time zone.
Echo date ('Y-m-d H: I: s ');
Date_default_timezone_set ('prc ');
Echo date ('Y-m-d H: I: s ');
We can see the difference.