java - How to convert long to datetime in android -


this question has answer here:

datetime value in long variable need convert format 2014-04-06t12:04:23.000z simplest approach.

try way,

android

simpledateformat sdf = new simpledateformat("yyyy-mm-dd't'hh:mm:ss.sssz", locale.us);  system.out.format("%30s %s\n", "yyyy-mm-dd't'hh:mm:ss.sssz", sdf.format(new date(0))); // 0 - "longvalue" 

result

yyyy-mm-dd't'hh:mm:ss.sssz 1970-01-01t00:00:00.000 

great android doc simpledateformat


Comments

Popular posts from this blog

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

Change the color of an oval at click in Java AWT -