Results 1 to 6 of 6

Thread: How to get GMT time and set system clock accordingly

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    1

    Exclamation How to get GMT time and set system clock accordingly

    How can one use the GMT time and set system clock to the time we get from GMT

  2. #2
    Frenzied Member oceanebelle's Avatar
    Join Date
    Jun 2005
    Location
    my n00k.
    Posts
    1,064

    Re: How to get GMT time and set system clock accordingly

    welcome to the forums!

    and I would like to help but I can only say about setting the system time. sorry .

    Use the SetSystemTime API

  3. #3
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: How to get GMT time and set system clock accordingly

    wamanma,

    You would need to get the time from the website location of one of several NTP servers around the world. The most commonly used one are the Navy's. Look here for servers http://tycho.usno.navy.mil/ntp.html

    I believe this is what you want.

  4. #4
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: How to get GMT time and set system clock accordingly

    A simple way to do this
    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3. 'What ever time is in txtTime, that will set the time. e.g. 15:38:00
    4. Time = txtTime.Text
    5.  
    6. End Sub
    7. 'But you will need some error checking for the time entered
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  5. #5
    PowerPoster
    Join Date
    Jul 2001
    Location
    Tucson, AZ
    Posts
    2,166

    Re: How to get GMT time and set system clock accordingly

    Search the forum for GMT and/or Universal Time. I think you will find some code.

  6. #6
    Fanatic Member
    Join Date
    Jan 2005
    Location
    In front of this pc.
    Posts
    580

    Re: How to get GMT time and set system clock accordingly

    Don't forget that you'll need to identify the offset (timezone) if you want the time to reflect local time. I *thought* I had some code here for doing that but danged if I can find it now (I do remember it took me some time to figure out so hopefully I didn't delete it).

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