1. SimpleDateFormat sDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//注意月份MM String today = sDateFormat.format(new Date());
Time******2006-12-06 11:42:34 2. int y,m,d,h,mi,s; Calendar cal=Calendar.getInstance(); y=cal.get(Calendar.YEAR); m=cal.get(Calendar.MONTH); d=cal.get(Calendar.DATE); h=cal.get(Calendar.HOUR_OF_DAY); mi=cal.get(Calendar.MINUTE); s=cal.get(Calendar.SECOND); System.out.println("现在时刻是"+y+"年"+m+"月"+d+"日"+h+"时"+mi+"分"+s+"秒");
现在时刻是2006年11月6日11时43分52秒 <INPUT name="textfield4" type="text" size="30" value="<%=y%>-<%=m%>-<%=d%>" id="IDFromDate">
3. Time******2006-12-6 11:42:34 Date d=new Date(); d.toLocaleString()
|