Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想设置一个 url 在用户单击忘记密码按钮后 3 小时过期,但我不知道将当前时间与时间戳进行比较以检查它是否超过 3 小时。
前任。在数据库中
request_time(timestamp) = 2012-10-22 02:00:00
expire_time(timestamp) = 2012-10-22 05:00:00
这就是我要做的:
strtotime('now')
<?php if( strtotime('2012-10-22 02:00:00') + 60*60*3 < time() ) { // expired }