I need to do some more complicated calculations with time and date values from my MySQL database with PHP.
I need to add or subtract different values from a specific date.
For instance:
- Substracting 1 Month
- Substracting 30 Days
- Substracting 4 Weeks
- Adding 4 months
- Adding 3 months
- Adding 90 days
- Addition 2 years
Please note that there is a difference between subtracting 1 month, 4 weeks or 30 days.
What is the preferred way to do this? Is there a smart library or can I do this using native PHP functions?
source
share