将x小时x分钟前转换回unix时间戳

inv*_*viz 2 php unix-timestamp

我正在寻找一个函数将"X Hours ago"和"X minutes ago"中显示的日期转换回php中的时间戳,任何人都有这个问题吗?

Jon*_*Jon 10

strtotime 已经这样做了:

$timestamp = strtotime("8 hours ago");
Run Code Online (Sandbox Code Playgroud)

有关详细信息,请参阅相关时间格式规范