特定の日付 (2012-12 など) が現在の日付より古いか新しいかを確認したい。
私は古い月をチェックする方法を知っています
if(strtotime('2012-12')<strtotime('-1 Months')){
echo "true"; // got TRUE ... correct!
} else {
echo "false";
}
しかし、新しいものはどうですか?
if(strtotime('2013-02')>strtotime('1 Months')){
echo "true";
} else {
echo "false"; // got FALSE ... incorrect !
}
新しい日付を確認すると、間違った結果が得られました。