目前我将时间存储在我的数据库中,如下所示:2010-05-17 19:13:37
Currently I store the time in my database like so: 2010-05-17 19:13:37
但是,我需要比较两次,我觉得如果是unix时间戳,例如1274119041
,会更容易做.(这两次是不同的)
However, I need to compare two times, and I feel it would be easier to do if it were a unix timestamp such as 1274119041
. (These two times are different)
那么如何将时间戳转换为 unix 时间戳?有没有简单的php函数呢?
So how could I convert the timestamp to unix timestamp? Is there a simple php function for it?
您正在寻找 strtotime()
这篇关于在 PHP 中将 TIMESTAMP 转换为 unix 时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!