Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Is there anyway to set the Timer to Greenich Time?

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am wondering if I can set the timer in VB to Greenich time instead of the computer's time?

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Murrati.
    Can you simply subract the difference?
    For example, create a Constant?
    I'm not sure which timer function you are referring to. The VB function which counts seconds from midnight? 0 to 86,399?

    Maybe this example will help you...

    Sub Test calls for a five second delay
    by passing the value 5 to LenTime in sub SD
    The function UTC_Timer takes the value
    of the current Computer timer and re-arranges
    it according to your constant, TimeDifference.
    I am 4 hours behind GMT. Therefore TimeDifference
    will = 14400. Or 60 Seconds * 60 Minutes * 4 Hours
    Change to suit...
    I hope this helps you,
    Tom

    'reflect my computer's 4 hours behind GMT
    Public Const TimeDifference As Long = 14400

    Sub Test()
    SD 5
    End Sub

    Sub SD(LenTime)
    Dim Start
    Start = UTC_Timer(Timer)
    Do While UTC_Timer(Timer) < Start + LenTime
    DoEvents
    Loop
    End Sub

    Public Function UTC_Timer(ComputerTimer As Long)
    If ComputerTimer - TimeDifference < 0 Then
    UTC_Timer = 86399 - Abs(ComputerTimer - TimeDifference)
    Else: UTC_Timer = ComputerTimer - TimeDifference
    End If
    End Function

    [ This Message was edited by: TsTom on 2002-04-23 21:56 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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