Want to get time in milliseconds in android Ex 19:57:21:522.How do i do this?Could not find any straight forward API's to do so.
Try SimpleDateFormat
http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
Use a pattern with a capital S
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String currentDateandTime = sdf.format(new Date());
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