jsp 오늘 날짜 세팅하기
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import ="java.util.*,java.text.SimpleDateFormat"%>
<%
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
Date startDate = new Date();
String sDate = sf.format(startDate);
%>
<script type="text/javascript">
var today = "<%=sDate%>";
alert("오늘 날짜는 "+today);
</script>
<%@ page import ="java.util.*,java.text.SimpleDateFormat"%>
<%
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
Date startDate = new Date();
String sDate = sf.format(startDate);
%>
<script type="text/javascript">
var today = "<%=sDate%>";
alert("오늘 날짜는 "+today);
</script>
댓글
댓글 쓰기