The comparison between the timestamps in php and the timestamps in javascript is essentially the same, but it is still a little different if the two are to be compared equally, this will go 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.