数据库字段 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)
有个winform程序,使用c#+mysql,需要在一个窗体设置mysql自动删除功能,包括自动删除多少天之前的数据以及是否开启自动删除功能,我程序退出后,还怎么控制Mysql自己删除啊?是不是要用mysql的event来实现?c#可以调用mysq ......
我对SQL SERVER和ACCESS比较熟,所以数据库的通用基础东西可以说都掌握的差不多了,我现在想要的就是以上两数据库的独特之处的介绍和应用介绍。
另外书最好对应最新版本 oracle是11g吧 10的也行;mysql是5.1吧
谢 ......