Results 1 to 3 of 3

Thread: Change System Time [Resolved]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Posts
    135

    Change System Time [Resolved]

    newbie (lazy) question:

    I need to change the system time in code.
    (please post code)

    Thank you.
    Last edited by vfluckey; Apr 3rd, 2003 at 11:51 AM.
    Hello? Underpaid code monkey speaking...

  2. #2
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    Here is a quick sample from allapi.com:
    VB Code:
    1. Private Type SYSTEMTIME
    2.     wYear As Integer
    3.     wMonth As Integer
    4.     wDayOfWeek As Integer
    5.     wDay As Integer
    6.     wHour As Integer
    7.     wMinute As Integer
    8.     wSecond As Integer
    9.     wMilliseconds As Integer
    10. End Type
    11. Private Declare Function SetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) As Long
    12. Private Sub Form_Load()
    13.     'KPD-Team 2000
    14.     'URL: [url]http://www.allapi.net/[/url]
    15.     'E-Mail: [email][email protected][/email]
    16.     Dim lpSystemTime As SYSTEMTIME
    17.     lpSystemTime.wYear = 2000
    18.     lpSystemTime.wMonth = 1
    19.     lpSystemTime.wDayOfWeek = -1
    20.     lpSystemTime.wDay = 24
    21.     lpSystemTime.wHour = 23
    22.     lpSystemTime.wMinute = 26
    23.     lpSystemTime.wSecond = 0
    24.     lpSystemTime.wMilliseconds = 0
    25.     'set the new time
    26.     SetSystemTime lpSystemTime
    27. End Sub
    McGenius

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Posts
    135
    Thanks, Works Great!
    Hello? Underpaid code monkey speaking...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width