<%
response.write Now()
response.write date()
response.write time()
response.write Year(now())
response.write month(now())
response.write day(now())
response.write hour(now())
response.write minute(now())
response.write second(now())
response.write weekday(now()) '요일값 : 일월화수목금토 순으로..
response.write Dateadd("d",3,Now()) '3일후
response.write DateDiff("yyyy","1983-10-10",Now()) '날짜 간격 구하기
%>
<?
echo floor(( strtotime(date("Y-m-d")) - strtotime("2016-01-01") )/86400); //PHP에서 날짜 간격 구하기 ASP DateDiff동일함!
echo $start = mktime(0,0,0,date("m"),date("d"),date("Y")); //한달전 날짜구하기 만약 20160111 이라면 20151211의 결과값을 표출!
echo date("Ymd", strtotime("-1 month", $start)); //한달전 날짜 구하기
?>
결과값 나열
2011-11-24 오후 5:31:59
2011-11-24
오후 5:31:59
2011
11
24
17
31
59
5
2011-11-27 오후 5:31:59
28
<%
'24시간 표현식
Function aaa(strValue)
aaa = Right("0"&strValue,2)
End function
Response.write aaa(hour(time)) &":"& aaa(minute(time)) &":"& aaa(second(time)) &"<br>"
%>
<%
'24시간 표현식
'현재시간을 20140618111323 표현
Function getTime()
getTime = Replace(Date(),"-","")&Right("0"&hour(Time),2)&Right("0"&minute(Time),2)&Right("0"&second(Time),2)
End Function
'현재시간 2014-06-18 표현
Function datetime(ndate)
datetime = Mid(ndate,1,4)&"-"&Mid(ndate,5,2)&"-"&Mid(ndate,7,2)
End Function
%>