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.
この形式で書かれた時刻を現在の時刻と比較して、この正確な瞬間がまだ発生しているかどうかを確認するにはどうすればよいですか(カウントダウンタイマー用です)が、時刻は次の形式である必要があります。
12/31/2012 5:00 AM UTC-0500
最終的には、現在の時刻がその日付よりも小さい場合はこれを表示し、そうでない場合はこれを表示します。
strtotimeは、文字列の日付をunixタイムスタンプに変換できます。これは、後で比較などに簡単に使用できます。
$timestamp = strtotime("12/31/2012 5:00 AM UTC-0500"); if (time() > $timestamp) ...