본문 바로가기
IT 개발

[개발 팁] asp 날짜관련 함수

by 로보찌빠냥 2011. 2. 11.


<%
response.write "now : " & now & "<br>" & vbcrlf
response.write "now + 1 : " & (now+1) & "<br>" & vbcrlf
response.write "date : " & date & "<br>" & vbcrlf
response.write "dateadd : " & DateAdd("m", 1, "31-Jan-95") & "<br>" & vbcrlf
response.write "datediff : " & DateDiff("d", DateAdd("m", 1, "31-Jan-95"),Now) & "<br>" & vbcrlf
response.write "datepart : " & DatePart("q", now) & "<br>" & vbcrlf
response.write "dateserial : " & DateSerial(1990 - 10, 8 - 2, 1 - 1) & "<br>" & vbcrlf
response.write "DateValue : " & DateValue("September 11, 1963") & "<br>" & vbcrlf
response.write "time : " & Time & "<br>" & vbcrlf
response.write "Timeserial : " & TimeSerial(12 - 6, -15, 0) & "<br>" & vbcrlf
response.write "timevalue : " & TimeValue("4:35:17 PM") & "<br>" & vbcrlf
theday="00-11-08 오전 9:50:31"
response.write isdate(theday) & "<BR>" & vbcrlf
response.write "second : " & second(now) & "<br>" & vbcrlf
response.write "second : " & second(theday) & "<br>" & vbcrlf
response.write "minute : " & Minute(now) & "<br>" & vbcrlf
response.write "hour : " & Hour(now) & "<br>" & vbcrlf
response.write "day : " & day(now) & "<br>" & vbcrlf
response.write "weekday : " & weekday(now) & "<br>" & vbcrlf
response.write "weekdayname : " & weekdayname(weekday(now)) & "<br>" & vbcrlf
response.write "month : " & month(now) & "<br>" & vbcrlf
response.write "monthname : " & monthname(month(now)) & "<br>" & vbcrlf
response.write "year : " & year(now) & "<br>" & vbcrlf

%>

 

 

실행결과

 

now : 2006-07-25 오후 6:52:24
now + 1 : 2006-07-26 오후 6:52:24
date : 2006-07-25
dateadd : 1995-02-28
datediff : 4165
datepart : 3
dateserial : 1980-05-31
DateValue : 1963-09-11
time : 오후 6:52:24
Timeserial : 오전 5:45:00
timevalue : 오후 4:35:17
isdate(theday) : True
second : 24
second : 31
minute : 52
hour : 18
day : 25
weekday : 3
weekdayname : 화요일
month : 7
monthname : 7월
year : 2006


[ 원문 : http://blog.naver.com/amoong25/100026680439 ]

반응형

댓글