How can i convert this time and date which coming from json data in android to milliseconds properly ??
2013-09-19T03:27:23+01:00
and what's the meaning of T ??
not sure about and what's the meaning of T ?? but you can use following code to get milliseconds.
String dateString="2013-09-19T03:27:23+01:00";
if (dateString != null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
Date testDate = null;
try {
testDate = sdf.parse(dateString);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Milliseconds==" + testDate.getTime());
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With