Calendar c = Calendar.getInstance();
try {
c.setTime(new SimpleDateFormat("yyyy-MM-dd").parse("2012-04-05"));
} catch (Exception e) {
}
System.out.println(c.getTimeInMillis());
jstl 获得系统时间
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:useBean id="now" class="java.util.Date" />
<fmt:formatDate value="${now}" pattern="yyyy年MM月dd日 HH:mm:ss"/>
<br/>