Is there anyway to set the Timer to Greenich Time?

Muratti

New Member
Joined
Apr 21, 2002
Messages
16
I am wondering if I can set the timer in VB to Greenich time instead of the computer's time?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top