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.
mysql テーブルに datetime 列があります。この列のデフォルト値は ' 0000-00-00 00:00:00' です。
0000-00-00 00:00:00
質問: チェック値が 0 より大きい場合の最善の方法は何ですか?
if (strtotime($datetime)>0)
if ($datetime=="0000-00-00 00:00:00")
PS: 私は Yii フレームワークを使用しています
ほとんどの場合、日付を日付と比較することをお勧めします。その場合、これが良い候補になります。
if (str_to_date($datetime)> str_to_date('0000-00-00 00:00:00'))
タグの幅または拡大縮小