1
我有Java代碼這樣的:JavaScript的日曆操作
//first moment of the today
Calendar cal = new GregorianCalendar();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
Calendar tomorrow = (Calendar)cal.clone();
tomorrow.add(Calendar.DAY_OF_YEAR, 1);
long time = d.getTime();
// if greater than today's first moment
if(time >= tomorrow.getTimeInMillis()){
...
}
...
我如何使用JavaScript重寫?
一些額外的文件,以防萬一(我的首選之一什麼JS :-)):https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date –
@Neves我接受它作爲你的評論的答案。投票評論你的評論。 – kamaci