Php Minus Date. I was experimenting with strtotime. Let us imagine that it is may 31 2019 so 2019 05 31 the function will not give 2019 04 31.
How can i subtract this time to see how long the person has been working. In the php code above we passed in 1 years as a parameter to strtotime. Date sub php 5 5 3 0 php 7 datetime sub date sub subtracts an amount of days months years hours minutes and seconds from a datetime object.
Let us imagine that it is may 31 2019 so 2019 05 31 the function will not give 2019 04 31.
Interval date diff date1 date2. Date1 new datetime now. How can i subtract this time to see how long the person has been working. Date2 new datetime tomorrow.