-
time() returns the UNIX timestamp of the current time, i.e., the number of seconds from the UNIX era (00:00:00 GMT January 1, 1970) to the current time.
Because PHP is a language that runs on a server, if you test it on your own machine, the time() function will read the time you pick up the device, convert it to seconds, and then change it to 00:00:00 to get the result.
So, no matter how your time zone is set, as long as your local machine time does not change, the result returned by the time() function will not change. In the future, you don't need to use the time() function anymore and read $server[ directly'request_time'] to get the results.
-
If the parameter is true, it will return 15 bits, otherwise it will return something like this: 1419902331
echo microtime(1);
It turns out that your 15 digits mean that there are no decimal places, but it is recommended that you use this.
-
microtime() is subtle without parameters, and is enough for 15 bits.
-
The default is 11 bits, and you can see if the database has fewer fields, preferably int(11).
-
Return 15 digits, if you want to return 14 digits, change 16 to 15.
function microtime_float()echo microtime_float();
echo "
echo time();
-
You wrote it wrong, the minute you use the same m as the month, it's May, of course it shows 05, it should be.
echo date('y-m-d h:i:s',time()) minutes you use the same m as the month, it's May, of course it shows 05.
Minutes you use the same m as the month, it's May now, and of course it's 05.
-
The php function time() returns the number of seconds from 00:00:00 on January 1, 1970 to the current time, which can be understood as a time expressed in seconds and expressed by integers.
time()+3600 indicates the time after adding an hour (3600 seconds) to the current time.
-
This is a matter of time difference, you can set the time difference in PHP to the time format of Shanghai.
-
$time=time();It is stored in time in the form of 1304677030
echo "$time"."
$alter_time=date('y-m-d h-i-s',"$time");
echo "$alter_time";
-
time() is the timestamp of the current time.
date('y-m-d h-i-s', time()) is the current time.
y m d h i s are all changeable intermediate - can also be changed to something else!
-
You use the date function to format the time.
-
gmtime() I haven't used it. time() gets the current server time. But the version above. There is a bug with time().
This bug doesn't necessarily happen. It was between 12 p.m. and 8 a.m. The time is the day before.
That is, there was a difference of 8 hours before 8 a.m. Does gmtime() have something to do with this? I don't know.
Solving the time() bug is to put it in.
The preceding semicolon is removed. Then change to.
asia/shanghai
-
One is standard time and the other is local time, isn't that clear? For example, if the time zone of the mainland is +8, if you set it, then your time will get the mainland time, and your gmtime will get the mainland time -8
-
ime() gets the current server time. But the version above. time() has a bug, which doesn't necessarily happen.
It was between 12 p.m. and 8 a.m. The time is the day before. That is, there was a difference of 8 hours before 8 a.m.
Does gmtime() have something to do with this? I don't know if the solution to the time() bug is to remove the semicolon in front of =. Then change to = asia shanghai
One is standard time and one is local time. For example, if the time zone of the mainland is +8, if you set it, then your time will get the mainland time, and your gmtime will get the mainland time -8
-
Maybe you don't set the time zone, the default is 0 time zone, and if you want to add 8 hours in China, you can set it.
date_default_timezone_set('asia/shanghai');
Variables can be included in double quotes, where $str reads look at the sea"$str";It will recognize that $str is a variable and explain the contents of the variable to get it"look at the sea", and single quotes'$str'It is to output the string $str, depending on the situation. Sometimes you need to make up a SQL statement with some variables, and double quotation marks are useful. >>>More
Mi Tu! me too!It's been two years since Moore was registered and I've seen it change. >>>More
This is actually the growing pain.
You also know that if you hit him, you might get ostracized. >>>More
The base cream with foundation is added, in addition to protecting the skin, the texture is light and refreshing, and the light base makeup makes the ** shiny, and the most important thing is breathable and comfortable. At present, there are more and more skin care products with a variety of effects such as foundation, sunscreen, nutrition, etc., which can also be said to be a development trend in the future. If you choose this product, then skin care becomes very simple, no need to apply layer by layer, just apply one product to achieve the triple effect of skin care, skin tone correction and sun protection. >>>More
Hello, the economic problem is that there is excess production capacity, enterprises are under-employed, and many of them even fail to reach the break-even point, resulting in a large number of idle social resources, and it is necessary to leak and expand the sales market. A large number of ordinary people have limited incomes, resulting in insufficient purchasing power, which makes it difficult for the economy to develop further rapidly. Efforts should be made to continue to increase people's incomes. >>>More