获取当前时间的JS代码我有写:
<script language="JavaScript">
<!--
function initDate(){
var date = new Date();
var curYear=date.getYear();
var curMonth=date.getMonth()+1;
var curDate=date.getDate();
var strDate=curYear +"-"+ curMonth +"-"+ curDate; }
//-->
</script>
但我现在要获取当前时间的后一天.请问各位该如何写. 谢谢了
<script language="JavaScript">
<!--
function initDate(){
var date = new Date();
var curYear=date.getYear();
var curMonth=date.getMonth()+1;
var curDate=date.getDate();
var strDate=curYear +"-"+ curMonth +"-"+ curDate; }
//-->
</script>
但我现在要获取当前时间的后一天.请问各位该如何写. 谢谢了
你怎么不把 getData +1 试验一下呢.
long month = Calendar.getInstance().getActualMaximum(Calendar.DAY_OF_MONTH);
或DateAdd("d", -1, date())
theCa.setTime(new Date());
theCa.add(theCa.DATE, 1);
date = theCa.getTime();
c.add(Calendar.DAY_OF_YEAR, 1);
Adds the specified (signed) amount of time to the given time field, based on the calendar's rules.参考
http://java.sun.com/j2se/1.4.2/docs/api/java/util/GregorianCalendar.html
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_YEAR, 1);
var y, m, d;
now.setDate(now.getDate() + 1);
y = now.getFullYear();
m = now.getMonth() + 1;
d = now.getDate();