数据库字段 dateline int (发布时间) 值是 1268053581
Java code:
for(int i=0;i<array_polls.size();i++)
{
Polls polls=(Polls)array_polls.get(i);
Threads threads = (Threads)pollotionDaoImpl.findPostsByid(polls.getTid());
long starttime=threads.getDateline()/1000;
long endtime= System.currentTimeMillis();
String runTime=Common.number_format((endtime-starttime)/1000f, "0.000000");
System.out.println("starttiem: "+starttime);
System.out.println("endtime: "+endtime);
System.out.println("runTime: "+runTime);
System.out.println("数据库时间"+Math.abs(threads.getDateline()/1000));
// System.out.println( Common.toDigit(String.valueOf(threads.getDateline()))*3600);
arry_threads.add(threads);
}
输出语句
starttiem: 1268053
endtime: 1268104946062
runTime: 1268103680.000000
数据库时间: 14676
要怎么样转换呀??
怎么从毫秒数转回来呀???
Date start = new Date(starttime*1000)