网站首页 > 网络编程教程 > JSP教程 > JSP取当前日期

JSP取当前日期

  • 作者:互联网
  • 时间:2009-07-03 17:04:13

2.

<%
ja***text.SimpleDateFormat formatter = new ja***text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

ja***util.Date currentTime = new ja***util.Date();//得到当前系统时间

String str_date1 = fo***tter.format(currentTime); //将日期时间格式化
String str_date2 = cu***ntTime.toString(); //将Date型日期时间转换成字符串形式
%>