PHP day difference calculation problem, occur on diff. month
Posted: Wed Mar 31, 2004 8:32 pm
guys, i need some help on PHP day difference calculation..
i have my date format as in YYYYMMDD, for instance 1st april 2004 = 20040401
it works fine if it is within the same month.. for instance:
20040310 - 20040305 = 5 days gap.. (since i am using simple subtractive code)
however, when it comes to different month, it tends to mix up:
20040430 - 20040330 = 100 days gap!! (suppose to be 1 month, 30 days!)
anyone can help me solve this problem? it's kinda urgent~

i have my date format as in YYYYMMDD, for instance 1st april 2004 = 20040401
it works fine if it is within the same month.. for instance:
20040310 - 20040305 = 5 days gap.. (since i am using simple subtractive code)
however, when it comes to different month, it tends to mix up:
20040430 - 20040330 = 100 days gap!! (suppose to be 1 month, 30 days!)
anyone can help me solve this problem? it's kinda urgent~