I need to convert timestamp string to long.
Here is my input string:
2016-08-10T11:24:57.182+0300
here is code witch I am trying to use for converting:
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.sssZ");
try {
Date date = simpleDateFormat.parse(timestamp);
long time = date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
result: 1470817622000
but when i check this long time here, it returns me this string:
10 august 2016 8:27:02 GMT
but this is different from the input string.
any idea why it happens and how to fix this?