jsp,怎样获取当前剩下的秒数呢???(函数?)
请问大家
怎样获取当前剩下的秒数呢???有函数吗?
-------------------------------------------------
如:(1). 24小时中,现在是 8:30 怎样算出还剩了多少秒呢?用秒数来输出!
(2). 24小时 = 24*60*60*1000 ???
请各位指点!谢谢各位!
------解决方案--------------------Calendar curDate = Calendar.getInstance();
Calendar tommorowDate = new GregorianCalendar(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DATE)+1, 0, 0, 0);
System.out.println((tommorowDate.getTimeInMillis() - curDate.getTimeInMillis())/1000);