I am getting confused while parsing a time difference[which I receive from a webpage].
For Example : I get a string like this : 2 years 10 weeks 3 days 6 hours 7 min ago
. Please note that the trailing s
in year
, week
, day
and hour
may not be there in case of unity and not present in the min
.
Currently, I want to get the difference stored like that and get the actual date and time[by subtracting from the current time?].
And, I am confused what to do? I know about the Time parsing methods but its not a regular time, Plus there's that trailing s
!!!
Can anyone suggest a good approach to this?