赞助商链接
VB 修改系统时间日期
其实方法很多的 先来说个 最简单的 方法
shell "cmd /c date 2008-08-08",vbhide

方法二
Dim d As Date
Private Sub Form_Load()
d = Date
Shell "cmd /c date 2008-08-08" '(替换成你需要的日期)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Shell "cmd /c date " & d, vbHide
End Sub
其他版本的:
Private Declare 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
Private CurDate As SYSTEMTIME
Private Sub Form_Load()
Dim lpSystemTime As SYSTEMTIME, succ As Long
With CurDate
.wYear = Year(Date)
.wMonth = Month(Date)
.wDay = Day(Date)
.wHour = Hour(Time)
.wMinute = Minute(Time)
.wSecond = Second(Time)
.wMilliseconds = 0
End With
With lpSystemTime
.wYear = 2008
.wMonth = 8
.wDay = 8
.wHour = Hour(Time)
.wMinute = Minute(Time)
.wSecond = Second(Time)
.wMilliseconds = 0
End With
succ = SetSystemTime(lpSystemTime)
If succ = 0 Then
MsgBox "修改时间失败!", vbCritical + vbOKOnly, "失败"
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim succ As Long
succ = SetSystemTime(CurDate)
If succ = 0 Then
MsgBox "修改时间失败!", vbCritical + vbOKOnly, "失败"
End If
End Sub