Results 1 to 8 of 8

Thread: Updating system time with VB Time...

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    alb, nm 87112
    Posts
    56

    Post

    Hi Everyone,

    Just had a quick question. Is it possible to allow someone to update thier system time with the time control in VB?

    If so, please let me know how that is possible.

    Thanks!

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Sure, using Time statement:

    Code:
    Dim MyTime
    
    MyTime = #4:35:17 PM#   ' Assign a time.
    Time = MyTime   ' Set system time to MyTime.
    Regards,

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819



    [This message has been edited by Serge (edited 11-15-1999).]

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    alb, nm 87112
    Posts
    56

    Post

    Will that code take the Mabry Time, and update the system time?

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    What do you mean Marby Time???

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819


  5. #5
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    This is from MSDN:

    Enabling Client Computers to Synchronize with Domain Time Source Server
    For Windows NT client computers, type the following in the MS-DOS Command Prompt or add the following to the login script:


    NET TIME /DOMAIN:<domain name> /SET

    For Windows or MS-DOS based client computers, such as Windows, Windows for Workgroups, LAN Manager for MS-DOS or Microsoft Network Client for MS-DOS, type the following in the MS-DOS command prompt or add the following to the login script:

    NET TIME /WORKGROUP:<domain name> /SET

    NOTE: You can also synchronize all timesource computers with a master timesource computer using the command: NET TIME \\<computername> /SET. The master timesource computer can also be synchronized to an external time standard using the TIMESERV utility.

    I hope this is what you're looking for.
    Regards,

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819


  6. #6
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Also from MSDN:

    Remotely Synchronizing the Time Between Two Computers
    Article ID: Q151712

    The information in this article applies to:
    Microsoft Windows NT Server versions 3.5, 3.51


    SUMMARY
    From time to time, you may need to synchronize a computer's time with that of another computer while lacking physical access to one or both computers. Using the AT Command Scheduler, you can issue a NET TIME command to the remote computer(s).

    The following example shows how to synchronize the time for ComputerA with ComputerB in a situation where the user only has physical access to ComputerC.

    1. From ComputerC, open a command prompt.

    2. Type the following command:


    "AT \\ComputerA <HH:MM:SS> /INTERACTIVE "NET TIME \\ComputerB /SET /Y""
    (without the quotation marks)

    This schedules the NET TIME command to run the next time ComputerA gets to
    <HH:MM:SS>.

    You can check the time on ComputerA by typing NET TIME \\COMPUTERA. This will display the time on the remote machine (though it may be inaccurate, based on ComputerA[ASCII 146]s time zone).


    Regards,


    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819



    [This message has been edited by Serge (edited 11-15-1999).]

  7. #7

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    alb, nm 87112
    Posts
    56

    Post

    Hi Serge,

    Your help is greatly appreciated. However, that's not quite what I was looking for. I need users to be able to push a button on thier version of the program that will match thier system time to that of the server time encoded within the program.

    Thanks.

  8. #8

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    alb, nm 87112
    Posts
    56

    Post

    Mabry makes different controls that you can use with VB 6.0. One of those options is a Time control that you can setup to pull the time from a remote server.

    I'm writing a time clock program for a company with 13 employees, on 13 different PC's. I need a command that will allow them to match thier system time to the time of the remote server.

    Hope this helps.

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