Comparison between the timestamp in php and the timestamp in javascript. The comparison between the timestamps in php and the timestamps in javascript is essentially the same, but it is a little different if the two are to be equal and compared, I don't pay attention to the comparison between the timestamps in php and the timestamps in javascript. Essentially, they are the same thing, but they are a little different if they are to be equal and compared, if you do not pay attention to it, you will be taken astray. Therefore, the two differences that are easy to ignore are listed here for your reference:
1) unit problem: most of the time stamps in php are obtained through the time () method, and the value is measured in seconds, in javascript, the value obtained from the getTime () method of the Date object is in milliseconds. Therefore, we need to compare whether the obtained time is the same day, you must note that they are converted to the same unit, 1 second = 1000 milliseconds, the remaining, you know, huh, huh.
2) time zone problem: As mentioned in the first point, the time () method is used in php to obtain the timestamp. for ease of display, we set the time zone of the current server in the php code, for example, servers in mainland China are usually set to the UTC + 8 zone. in this way, the time () method is no longer obtained from 00:00:00 on January 1, January 1, 1970, but from 08:00:00 on January 1, January 1, 1970, js usually does not set the time zone. Therefore, it starts from 00:00:00, January 1, January 1, 1970, so it is easy to cause inconsistency in this place.
Materialism tells us that we need to look at the essence of things through the phenomena. The two timestamps are essentially the combination of years, months, days, hours, minutes, and seconds, if the results do not match the expected results, the best way is to output the values of the year, month, and day, and compare them one by one, it is easy to find the problem.
...