Android : Parse date from string to get miliseconds

on Monday, February 16, 2015


I'm trying to get the miliseconds from an string that contains a date, but seems that im getting the wrong value. This is the string im trying to parse: 2015-03-01 00:00:00, I'm doing this to parse it:



DateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
Date inputDate = dateFormat.parse(data.get(position).getValidTo());
Log.d("--", inputDate.getDay() + " | " + inputDate.getMonth());

0 comments:

Post a Comment