[ASP] 날짜 처리 함수 - Now(), Date(), Time(), FormatDateTime() - [최근수정:2009-07-16]
개발 - 예제 모음/ASP 2009. 7. 9. 16:52첫 등록일 : 2008-07-09
최종 수정일 : 2009-07-16
이 자료는 지속적으로 업데이트 됩니다.
Now() ==> 2009-07-09 오후 4:48:49
Date() ==> 2009-07-09
Time() ==> 오후 4:48:49
FormatDateTime(Now(), 0) ==> 2009-07-09 오후 4:48:49
FormatDateTime(Now(), 1) ==> 2009년 7월 9일 목요일
FormatDateTime(Now(), 2) ==> 2009-07-09
FormatDateTime(Now(), 3) ==> 오후 4:48:49
FormatDateTime(Now(), 4) ==> 16:48
-----------------------
** YYYY-MM-DD HH24:MI:SS (오라클 기준)
FormatDateTime(Now(), 2) ==> 2009-07-09
FormatDateTime(Now(), 4) ==> 16:48
Right(Now(), 3) ==> :49
====> 2009-07-09 16:48:49
-----------------------
Left(Date(), 4) ==> 2009 (년)
Mid(Date(), 6, 2) ==> 07 (월)
Int(Mid(Date(), 6, 2)) ==> 7 (월)
<%
response.write "Now() ==> " & Now() & "<br>"
response.write "Date() ==> " & Date() & "<br>"
response.write "Time() ==> " & Time() & "<br>"
response.write "FormatDateTime(Now(), 0) ==> " & FormatDateTime(Now(), 0) & "<br>"
response.write "FormatDateTime(Now(), 1) ==> " & FormatDateTime(Now(), 1) & "<br>"
response.write "FormatDateTime(Now(), 2) ==> " & FormatDateTime(Now(), 2) & "<br>"
response.write "FormatDateTime(Now(), 3) ==> " & FormatDateTime(Now(), 3) & "<br>"
response.write "FormatDateTime(Now(), 4) ==> " & FormatDateTime(Now(), 4) & "<br>"
response.write "-----------------------" & "<br>"
response.write "FormatDateTime(Now(), 2) ==> " & FormatDateTime(Now(), 2) & "<br>"
response.write "FormatDateTime(Now(), 4) ==> " & FormatDateTime(Now(), 4) & "<br>"
response.write "Right(Now(), 3) ==> " & Right(Now(), 3) & "<br>"
response.write "====> " & FormatDateTime(Now(), 2) & " " & FormatDateTime(Now(), 4) & Right(Now(), 3) & "<br>"
%>
최종 수정일 : 2009-07-16
이 자료는 지속적으로 업데이트 됩니다.
Date() ==> 2009-07-09
Time() ==> 오후 4:48:49
FormatDateTime(Now(), 0) ==> 2009-07-09 오후 4:48:49
FormatDateTime(Now(), 1) ==> 2009년 7월 9일 목요일
FormatDateTime(Now(), 2) ==> 2009-07-09
FormatDateTime(Now(), 3) ==> 오후 4:48:49
FormatDateTime(Now(), 4) ==> 16:48
-----------------------
** YYYY-MM-DD HH24:MI:SS (오라클 기준)
FormatDateTime(Now(), 2) ==> 2009-07-09
FormatDateTime(Now(), 4) ==> 16:48
Right(Now(), 3) ==> :49
====> 2009-07-09 16:48:49
-----------------------
Left(Date(), 4) ==> 2009 (년)
Mid(Date(), 6, 2) ==> 07 (월)
Int(Mid(Date(), 6, 2)) ==> 7 (월)
response.write "Now() ==> " & Now() & "<br>"
response.write "Date() ==> " & Date() & "<br>"
response.write "Time() ==> " & Time() & "<br>"
response.write "FormatDateTime(Now(), 0) ==> " & FormatDateTime(Now(), 0) & "<br>"
response.write "FormatDateTime(Now(), 1) ==> " & FormatDateTime(Now(), 1) & "<br>"
response.write "FormatDateTime(Now(), 2) ==> " & FormatDateTime(Now(), 2) & "<br>"
response.write "FormatDateTime(Now(), 3) ==> " & FormatDateTime(Now(), 3) & "<br>"
response.write "FormatDateTime(Now(), 4) ==> " & FormatDateTime(Now(), 4) & "<br>"
response.write "-----------------------" & "<br>"
response.write "FormatDateTime(Now(), 2) ==> " & FormatDateTime(Now(), 2) & "<br>"
response.write "FormatDateTime(Now(), 4) ==> " & FormatDateTime(Now(), 4) & "<br>"
response.write "Right(Now(), 3) ==> " & Right(Now(), 3) & "<br>"
response.write "====> " & FormatDateTime(Now(), 2) & " " & FormatDateTime(Now(), 4) & Right(Now(), 3) & "<br>"
%>