SetSystemTime The SetSystemTime function sets the current system time and date. The system time is expressed in Coordinated Universal Time (UTC). BOOL SetSystemTime( CONST SYSTEMTIME *lpSystemTime // system time ); Parameters lpSystemTime [in] Pointer to a SYSTEMTIME structure that contains the current system date and time. The wDayOfWeek member of the SYSTEMTIME structure is ignored. Return Values If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, call GetLastError. Res Windows NT/2000/XP: The SetSystemTime function enables the SE_SYSTEMTIME_NAME privilege before changing the system time. This privilege is disabled by default. For more information about security privileges, see Privileges. Example Code For an example, see Setting the System Time. Requirements Windows NT/2000/XP: Included in Windows NT 3.1 and later. Windows 95/98/Me: Included in Windows 95 and later. Header: Declared in Winbase.h; include Windows.h. Library: Use Kernel32.lib.See Also Time Overview, Time Functions, GetSystemTime, SetSystemTimeAdjustment, SYSTEMTIME
改变文件的修改日期Private Sub Command2_Click() Dim MyDate Dim FileName As String FileName = "C:\MyProgram.exe" MyDate = Date$ ' MyDate 的值为系统当前的日期。 ' 设置系统日期 Date = "2002-2-20" Open FileName For Append As #1 Close #1 Date = MyDate ' 设置回来 End Sub
time="时间“
date="日期"
好象是setsystemtime()
Time = ("13:50")
The SetSystemTime function sets the current system time and date. The system time is expressed in Coordinated Universal Time (UTC). BOOL SetSystemTime(
CONST SYSTEMTIME *lpSystemTime // system time
);
Parameters
lpSystemTime
[in] Pointer to a SYSTEMTIME structure that contains the current system date and time.
The wDayOfWeek member of the SYSTEMTIME structure is ignored. Return Values
If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, call GetLastError. Res
Windows NT/2000/XP: The SetSystemTime function enables the SE_SYSTEMTIME_NAME privilege before changing the system time. This privilege is disabled by default. For more information about security privileges, see Privileges. Example Code
For an example, see Setting the System Time. Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.See Also
Time Overview, Time Functions, GetSystemTime, SetSystemTimeAdjustment, SYSTEMTIME
改变文件的修改日期Private Sub Command2_Click()
Dim MyDate
Dim FileName As String
FileName = "C:\MyProgram.exe"
MyDate = Date$ ' MyDate 的值为系统当前的日期。
' 设置系统日期
Date = "2002-2-20"
Open FileName For Append As #1
Close #1
Date = MyDate ' 设置回来
End Sub
在VB5.0+Win98SE下通过http://www.csdn.net/expert/topic/533/533248.xml
Date = "2002-2-20"
怎么老没有人问答我?
所以还是用内建函数.