http://www.wzjcw.net/vbgood/taishan/index.html006 FormatDate 改变系统日期格式,就是Date函数得到值,如把01/12/01改为2001-01-12。

解决方案 »

  1.   

    将欲修改的事件或日期传给time 或 date
    time="时间“
    date="日期"
      

  2.   

    api好象有个函数可以改系统时间
    好象是setsystemtime()
      

  3.   

    如:
    Time = ("13:50")
      

  4.   

    用date,time函数,但给出的日期要与系统格式一致
      

  5.   

    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 
      

  6.   


    改变文件的修改日期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
      

  7.   

    '  设置系统日期
      Date  =  "2002-2-20"
      

  8.   

    有的用就用呗!对了问一下,api快还是内建函数快?
    怎么老没有人问答我?
      

  9.   

    API快吧,但不安全,而且不利于移植.
    所以还是用内建函数.