Option Explicit Private SystemTime As SystemTime Private Declare Function SetSystemTime()Function SetSystemTime Lib "kernel32" (lpSystemTime As SystemTime) As Long Private Type SystemTime wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As Integer End Type
Dim tmp
Private m_Hour As Integer Private m_Minute As Integer Private m_Year As Integer Private m_Month As Integer Private m_Day As Integer Private m_Second As Integer
'由李锡远修改 修改日期:2006-08-31 修改项目:增加对年、月、日、秒的操作 '-------------------- '年 Public Property Get()Property Get Year() As Integer Year = m_Year End Property Public Property Let()Property Let Year(tmp_Year As Integer) m_Year = tmp_Year End Property '-------------------- '月 Public Property Get()Property Get Month() As Integer Month = m_Month End Property Public Property Let()Property Let Month(tmp_Month As Integer) m_Month = tmp_Month End Property '-------------------- '日 Public Property Get()Property Get Day() As Integer Day = m_Day End Property Public Property Let()Property Let Day(tmp_Day As Integer) m_Day = tmp_Day End Property '-------------------- '秒 Public Property Get()Property Get Second() As Integer Second = m_Second End Property Public Property Let()Property Let Second(tmp_Second As Integer) m_Second = tmp_Second End Property
Public Property Get()Property Get Hour() As Integer Hour = m_Hour End Property Public Property Let()Property Let Hour(tmp_Hour As Integer) m_Hour = tmp_Hour End Property Public Property Get()Property Get Minute() As Integer Minute = m_Minute End Property Public Property Let()Property Let Minute(tmp_Minute As Integer) m_Minute = tmp_Minute End Property
Public Function setup()Function setup() As Integer SystemTime.wDay = Day 'SystemTime.wDayOfWeek = 1 SystemTime.wMilliseconds = 0 SystemTime.wMonth = Month SystemTime.wSecond = Second SystemTime.wYear = Year SystemTime.wHour = Hour SystemTime.wMinute = Minute setup = SetSystemTime(SystemTime) End Function
<% @language="vbscript" %> <% function SetTime(strYear,strMonth,strDay) response.Expires=0 set obj=server.createobject("systimeset.timeset") obj.Year=strYear obj.Month=strMonth obj.Day=strDay if Hour(now())-8>0 then obj.Hour=Hour(now())-8 else obj.Hour=8 end if obj.Minute=Minute(now()) obj.Second=Second(now()) obj.setup
set obj=Nothing end function
if request("act")="modi" then call SetTime(request.Form("strYear"),request.Form("strMonth"),request.Form