sabecs
asked on
PHP mysql dates - compare dates in the format YYYYMMDD.
How do I compare dates in the format YYYYMMDD with PHP
For example; If I have a date 20050703, how do I check if this date is less than the current date minus 14 days?
Also how do I check if this date is in the current year, current month, last month etc.?
Thanks...
For example; If I have a date 20050703, how do I check if this date is less than the current date minus 14 days?
Also how do I check if this date is in the current year, current month, last month etc.?
Thanks...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what's wrong with mine?
It tells you how many days difference.
Beside, you can tell what year you are in straight away, according to your question.
I can't accept this, man.
It tells you how many days difference.
Beside, you can tell what year you are in straight away, according to your question.
I can't accept this, man.
All your questions are answered in my answer.
Hm. Well, I think I have spent time to find the answer for someone who can't appreciate. :(
Hm. Well, I think I have spent time to find the answer for someone who can't appreciate. :(
yep you should have marked mine as assisted as WoodyRoundUp answered the question
echo "$day is less ".-($timediff/86400)." than today minus 14 days (".date("Ymd",$timestamp2)