SetSystemTime VB声明
Declare Function SetSystemTime Lib "kernel32" Alias "SetSystemTime" (lpSystemTime As SYSTEMTIME) As Long
说明
设置当前系统时间
返回值
Long,非零表示成功,零表示失败。会设置GetLastError
参数表
参数 类型及说明
lpSystemTime SYSTEMTIME,这个结构指定了新的地方时间。其中的wDayOfWeek条目会被忽略 ====================================================================
SYSTEMTIME 类型定义
Type SYSTEMTIME ' 16 Bytes
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
说明
This structure contains date and time information.
字段表
字段 类型与说明
wYear Integer,The current year.
wMonth Integer,The current month. January is 1.
wDayOfWeek Integer,The current day of the week. Sunday is 0.
wDay Integer,The current day of the month.
wHour Integer,The current hour.
wMinute Integer,The current minute.
wSecond Integer,The current second.
wMilliseconds Integer,The current millisecond.
Declare Function SetSystemTime Lib "kernel32" Alias "SetSystemTime" (lpSystemTime As SYSTEMTIME) As Long
说明
设置当前系统时间
返回值
Long,非零表示成功,零表示失败。会设置GetLastError
参数表
参数 类型及说明
lpSystemTime SYSTEMTIME,这个结构指定了新的地方时间。其中的wDayOfWeek条目会被忽略 ====================================================================
SYSTEMTIME 类型定义
Type SYSTEMTIME ' 16 Bytes
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
说明
This structure contains date and time information.
字段表
字段 类型与说明
wYear Integer,The current year.
wMonth Integer,The current month. January is 1.
wDayOfWeek Integer,The current day of the week. Sunday is 0.
wDay Integer,The current day of the month.
wHour Integer,The current hour.
wMinute Integer,The current minute.
wSecond Integer,The current second.
wMilliseconds Integer,The current millisecond.
dim dtMytime as date
dtMytime='时间"
Time=dtMytime
何时结帐:
http://www.csdn.net/expert/topic/565/565536.xml(怎样使text中的字符显示为“******”)
Time函数就可以取或设
还有Date
设置系统时间。语法Time = time必要的 time 参数,可以是任何能够表示时刻的数值表达式、字符串表达式或它们的组合。说明如果 time 是一字符串,则 Time 会试着根据系统指定的时间,利用时间分隔符将其转换成一个时间。如果无法转换成一个有效的时间,则会导致错误发生。