How Can I Obtain Greenwich Mean Time in VB? 
Author Message
 How Can I Obtain Greenwich Mean Time in VB?

Hi,

I'm writing an application, using VB 6.0 Professional, and I need to send some
time values, to an external application, in Greenwich Mean Time (GMT).  From
what I can tell, VB does not include routines to convert local time to GMT.
Obviously I can obtain the current LOCAL time (with the "Now" function), but
how can I convert that to GMT?

Does anyone know of any existing routines that will do this, or where I might
FIND such routines?  It would be a big help; I thank you, and the people I
work with thank you.

John Abraham



Mon, 04 Jun 2001 03:00:00 GMT  
 How Can I Obtain Greenwich Mean Time in VB?
Hi,
Use the API GetSystemTime

This will load a SYSTEMTIME structure with the
current system time, which is given in Coordinated
Untiversal Time (UTC) also known as GMT.

Regards to group
David Chriscole
(Applications Developer VB5+6)

(www)          http://www.bigfoot.com/~tigerman_uk


Quote:
>Hi,

>I'm writing an application, using VB 6.0

Professional, and I need to send some
Quote:
>time values, to an external application, in

Greenwich Mean Time (GMT).  From
Quote:
>what I can tell, VB does not include routines to

convert local time to GMT.
Quote:
>Obviously I can obtain the current LOCAL time

(with the "Now" function), but
Quote:
>how can I convert that to GMT?

>Does anyone know of any existing routines that

will do this, or where I might
Quote:
>FIND such routines?  It would be a big help; I

thank you, and the people I
Quote:
>work with thank you.

>John Abraham




Mon, 04 Jun 2001 03:00:00 GMT  
 How Can I Obtain Greenwich Mean Time in VB?
Quote:

>I'm writing an application, using VB 6.0 Professional, and I need to send
some
>time values, to an external application, in Greenwich Mean Time (GMT).

<cut>

See http://home.earthlink.net/~butlerbob/vb/misc/timezone.htm



Mon, 04 Jun 2001 03:00:00 GMT  
 How Can I Obtain Greenwich Mean Time in VB?

read the value of
HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\TimeZoneInformation\Bias
from the registry into a variable, divide by 60 minutes and that
tells you how many hours ahead or behind GMT you are.

LoneStar

Quote:

> Hi,

> I'm writing an application, using VB 6.0 Professional, and I need to send some
> time values, to an external application, in Greenwich Mean Time (GMT).  From
> what I can tell, VB does not include routines to convert local time to GMT.
> Obviously I can obtain the current LOCAL time (with the "Now" function), but
> how can I convert that to GMT?

> Does anyone know of any existing routines that will do this, or where I might
> FIND such routines?  It would be a big help; I thank you, and the people I
> work with thank you.

> John Abraham




Mon, 04 Jun 2001 03:00:00 GMT  
 How Can I Obtain Greenwich Mean Time in VB?


Quote:
>Hi,

>I'm writing an application, using VB 6.0 Professional, and I need to send some
>time values, to an external application, in Greenwich Mean Time (GMT).  From
>what I can tell, VB does not include routines to convert local time to GMT.
>Obviously I can obtain the current LOCAL time (with the "Now" function), but
>how can I convert that to GMT?

>Does anyone know of any existing routines that will do this, or where I might
>FIND such routines?  It would be a big help; I thank you, and the people I
>work with thank you.

>John Abraham


I may be missing something but what is wrong with simply adding or
deducting 0 to 12 hours to whatever local time you have depending on
your locality.
--
David Batty


Tue, 05 Jun 2001 03:00:00 GMT  
 How Can I Obtain Greenwich Mean Time in VB?
Quote:
>I may be missing something but what is wrong with
simply adding or
>deducting 0 to 12 hours to whatever local time

you have depending on

Quote:
>your locality.

Fair comment BUT if the program were released to
different people in DIFFERENT timezones using that
method, the app would have to be hard coded for
each.  Much better to let the OS do the donkey
work for you with a VERY simple API. (see my
earlier post).

Regards to group
Dave Chriscole
(Applications Developer VB5+6)

(www)          http://www.bigfoot.com/~tigerman_uk

Quote:


Abraham

>>Hi,

>>I'm writing an application, using VB 6.0

Professional, and I need to send some
Quote:
>>time values, to an external application, in

Greenwich Mean Time (GMT).  From
Quote:
>>what I can tell, VB does not include routines to

convert local time to GMT.
Quote:
>>Obviously I can obtain the current LOCAL time

(with the "Now" function), but
Quote:
>>how can I convert that to GMT?

>>Does anyone know of any existing routines that

will do this, or where I might
Quote:
>>FIND such routines?  It would be a big help; I

thank you, and the people I
Quote:
>>work with thank you.

>>John Abraham

>I may be missing something but what is wrong with
simply adding or
>deducting 0 to 12 hours to whatever local time

you have depending on
Quote:
>your locality.
>--
>David Batty



Wed, 06 Jun 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Greenwich Mean Time

2. HELP: getting Greenwich Mean Time

3. how to calculate the GMT (greenwich mean time)

4. Converting Greenwich Mean Time

5. Greenwich Mean Time

6. Converting Greenwich Mean Time

7. Convert Greenwich Mean Time to EST

8. How to Convert GMT(Greenwich) Time to short date and time and vice versa

9. Urgent!! Greenwich Mean Time?

10. line graph in vb (canned routine)

11. 'Canned' data in VB program

12. Obtain date/Time from server?

 

 
Powered by phpBB® Forum Software