I created this include having in mind situations where more friendly time inputs could come handier than specifying everything in minutes when we're talking about, let's say, ban times.
Instead of the user thinking how many minutes a day, a week, 2 hours or 3 months could be, this parser would solve this issue in a very elegant and practical way.
It takes inputs in the form of 3d
(3 days), 4w2h
(4 weeks and 2 hours), or even 1y1y120d
and will sum up to the proper 2 years and 120 days.
The function sums up all valid time inputs from the string, calculates the future date it sums up to and returns that date as a UNIX timestamp.
If any questions, criticism or feedback (which is always appreciated) let me know down below. Thanks!
Include and Test Plugin Sources on GitHub!