<%String str="";
GregorianCalendar now = new GregorianCalendar();
SimpleDateFormat fmtrq = new SimpleDateFormat("yyyy年MM月dd日",Locale.US);
SimpleDateFormat df =new SimpleDateFormat("yyyy-MM-dd",Locale.US);
str=str+" <option value="+df.format(now.getTime())+" >"+fmtrq.format(now.getTime())+"</option> ";
for (int i=0;i<30;i++){
now.add(GregorianCalendar.DATE,-1);
str=str+" <option value="+df.format(now.getTime())+" >"+fmtrq.format(now.getTime())+"</option> ";
java.util.Date d = now.getTime();
}
%>
GregorianCalendar now = new GregorianCalendar();
SimpleDateFormat fmtrq = new SimpleDateFormat("yyyy年MM月dd日",Locale.US);
SimpleDateFormat df =new SimpleDateFormat("yyyy-MM-dd",Locale.US);
str=str+" <option value="+df.format(now.getTime())+" >"+fmtrq.format(now.getTime())+"</option> ";
for (int i=0;i<30;i++){
now.add(GregorianCalendar.DATE,-1);
str=str+" <option value="+df.format(now.getTime())+" >"+fmtrq.format(now.getTime())+"</option> ";
java.util.Date d = now.getTime();
}
%>
Date time=new Date();
getYear(),getMonth(),getDay()
out.println(dt.toLocalString());
out.println(dt.toLocaleString());//刚才少了一个"e"