728x90
01.<%
02.    ' 금일 날짜 표현방법
03.    Response.write Right("0000"&Year(date),4) &"-"& Right("00"&Month(date),2) &"-"&Right("00"&Day(date),2)
04.  
05.    ' 1년전 날짜 구하기
06.    Tdate = DateAdd("m", -12 DateValue(now))
07.    Response.write Tdate &"<BR>"
08.  
09.  
10.    ' 7일후 날짜 구하기
11.    Tdate = DateAdd("d", 7 DateValue(now))
12.    ' or
13.    Tdate = dateadd("d", 7, Now())
14.    Response.write Tdate &"<BR>"
15.   
16.  
17.    '순수히 날짜만 구할려면 MID 함수 사용
18.    Response.write MID(Tdate,1,10)
19.  
20.  
21.    '"-" 문자열을 제거할려면 replace 함수를 사용하면 됩니다.
22.    Response.write replace("문자열", "-", "")
23.%>

728x90

'프로그래밍 > asp' 카테고리의 다른 글

ASP에서 CSV 파일 생성하기  (0) 2011.08.03
ON Error Resume Next  (0) 2011.06.24
ASP 오류 'ASP 0115'  (0) 2011.06.15
asp 함수 정리  (0) 2011.06.08
asp 함수  (0) 2011.06.01

+ Recent posts