i’m trying to get a time different between now and some future date string that i receive from somewhere else…
like this:
i have a string of future date input in this format: “2015-10-08T11:01:29+00:00”
so now i would like to get the time from now to my future date string input…
there are so many approach for this (you can suggest me the best approach) but what i can think of is:
convert both input and now to unix milisecond time, minus it then convert it back again to time…
question is: is my approach will be work?
and i got a problem parsing the input string…
i did:
def dateObject= Date.parse(“yyyy-MM-dd’T’HH:mm:ss’Z’”, “2015-10-08T11:01:29+00:00”)
but it return me an error: error java.text.ParseException: Unparseable date: “2015-10-08T11:01:29+00:00” @ line 29226
anyone have experince getting a time different?
my expected outcome later will be:
from now to the future date is: 3 hours 23 mins 51 secs