• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Time difference without SimpleDateFormat

Hi everyone :)

i'm a bit new to android development so this might be noob-ish.

I am using API 16 which does not have the SimpleDateFormat function.
So instead I'm using
"String example1 = DateFormat.getDateTimeInstance().format(new Date());
String example2 = DateFormat.getDateTimeInstance().format(new Date());"

which outputs
"Jul 19, 2016 1:46:14 PM"
&
"Jul 19, 2016 1:46:40 PM"

What I am trying to do is get the time difference between these two strings; I have been scratching my head on how to do this, I tried using by using for loops with the .matches function (which I still don't understand fully)
example : ("[a-zA-Z0-9 *]+$") o_Oo_O

to does anyone have any suggestions on how to calculate the time difference? :)
Much appreciated :)
 
Thank you ! :)

Never knew about the Joda library; it opened many different options and functions that helped me complete my tasks. Plus I learnt something new
Much appreciated :D
 
Back
Top Bottom