<%
Const cTimeOffset=0
DIM strServerDateTime, strDateTime, strTime, strDate, strWeek, strMonth, strDay, strYear

strServerDateTime = DateAdd("h", cTimeOffset, Now())

strTime = FormatDateTime(strServerDateTime, 3)
strDate = Replace(FormatDateTime(strServerDateTime, 2),".","/")

strDateTime = strDate & " " & strTime
strWeek = Replace(FormatDateTime(DateAdd("d", -7, strServerDateTime), 2),".","/")
strMonth = DATEPART("m", strServerDateTime)
strDay = DATEPART("d", strServerDateTime)
strYear = DATEPART("yyyy", strServerDateTime)

DIM iDay,iMonth, iYear,iHour,iWeek
IF Request.QueryString("m") = "current" or Request.QueryString("m") = "" THEN
	iMonth = month(strServerDateTime)
ELSE
	iMonth = Cint(Request.QueryString("m"))
END IF
IF Request.QueryString("y") = "current" or Request.QueryString("y") = "" THEN
	iYear = year(strServerDateTime)
ELSE
	iYear = Cint(Request.QueryString("y"))
END IF
IF Request.QueryString("d") = "current" or Request.QueryString("d") = "" THEN
	iDay = day(strServerDateTime)
ELSE
	iDay = Cint(Request.QueryString("d"))
END IF
iHour=hour(strServerDateTime)
iWeek=DatePart("w",strServerDateTime)-1
if(iDay>31 or iDay<0) then
	iDay="01"
end if
if(iDay<10) then
	iDay="0"&iDay
end if
if(iMonth<10) then
	iMonth="0"&iMonth
end if
if(iHour<10) then
	iHour="0"&iHour
end if
strDate=iYear&"-"&iMonth&"-"&iDay
'response.Write("strServerDateTime"&strServerDateTime&"<br>")
'response.Write("strDateTime"&strDateTime&"<br>")
'response.Write("strTime"&strTime&"<br>")
'response.Write("strDate"&strDate&"<br>")
'response.Write("strWeek"&strWeek&"<br>")
'response.Write("strMonth"&strMonth&"<br>")
'response.Write("strDay"&strDay&"<br>")
'response.Write("strYear"&strYear&"<br>")
%>