答案是使用 PHP 的 strtotime 函数可以将时间日期转换为时间戳。例如,strtotime('2022-01-01 00:00:00') 可以将指定的日期时间转换为对应的时间戳。
strtotime
strtotime('2022-01-01 00:00:00')