Home >Backend Development >PHP Problem >How to convert date to unix timestamp in php
How to convert date to unix timestamp in php: You can use strtotime function to convert date to unix timestamp, such as [strtotime('2021-01-24 08:15:42')].
The operating environment of this article: windows10 system, php 7.3, thinkpad t480 computer.
Function introduction:
The strtotime() function parses any English text date or time description into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 GMT).
Syntax:
strtotime(time,now);
Parameters:
strtotime('2010-03-24 08:15:42')Related recommendations:
The above is the detailed content of How to convert date to unix timestamp in php. For more information, please follow other related articles on the PHP Chinese website!