Link to home
Start Free TrialLog in
Avatar of qader99
qader99Flag for India

asked on

adding or sutracting dates

how to add or subtract two given dates using php

please help with example if possible

Thanks
Avatar of us111
us111
Flag of Luxembourg image

hmm give me examples of what you wish and need
For example : 03-15-2000 + 03-18-2000 = ?????
Could you explain ?
thanks
Avatar of aikon
aikon

Hi gader99,

Plz try to be more explicit.

Are they numeric or string data?

Regards.
Avatar of qader99

ASKER

Yes uss111 I want to do something similar to your example.
basically I have two date in (Y-m-d) format and I want to subtract them and get the number of days between them.
for example (2000-03-15)-(200-02-29) = 15 (days)

One of the two dates one is todays date which is derived from date('Y-m-d') function. And the other is derived by concatinating certain variables which make up a valid date.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of maxkir
maxkir
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hmm I don't think so, it's enough :)
Avatar of qader99

ASKER

Thank You