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.
現在のサーバー時刻とデータベースの DATETIME (2012-01-01 00:00:01 として定義) エントリとの差を秒単位で表示しようとしています。最新のエントリの違いを表示したいだけです。
いくつかの結果を得ることができましたが、結果が正しくないことはわかっています。誰かが助けることができれば、それは素晴らしいことです。ありがとう!
それは次のように簡単です: -
echo time() - strtotime('2012-01-01 00:00:01');
time() strtotime()
select TIMESTAMPDIFF(second, '2012-01-01 00:00:01', current_timestamp) as date_diff