I am storing some time related fields in my database. When the field gets stored, it takes the value like "50 days" to make the UX better, then on the backend I convert this number to seconds with strtotime('50 days', 0);
which results in 4320000.
The question is, how do I make this number of seconds go back to 50 (or something lower if time has passed) to represent the remaining day(s) (ie. it returns an integer)?