java - convert milliseconds to date -
this question has reply here:
how convert currenttimemillis date in java? 9 answersserver sending me time 1390361405210+0530 if want convert in date should have add together 0530 1390361405210 , calculate date , time?
any suggestion should appreciated.thanks
public static void main( string[] args ) { dateformat formatter = new simpledateformat("dd/mm/yyyy hh:mm:ss"); long milliseconds=1390361405210l; date date = new date(milliseconds); calendar calendar = calendar.getinstance(); calendar.settimeinmillis(milliseconds); system.out.println(formatter.format(calendar.gettime())); system.out.println(formatter.format(date)); }
java datetime
No comments:
Post a Comment