Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I convert a GMT Time value?
Message
From
27/11/2001 07:32:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
27/11/2001 07:22:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00586211
Message ID:
00586226
Views:
17
>>>I need to convert a GMT DateTime value to the appropriate local time value.
>>>Does anybody know of any functions that obtain the GMT offset?
>>>
>>>TIA
>>
>>If you know your time-zone offset (for instance, "+2"), just add that many hours to the GMT time. For DateTime values, you have to add seconds, so you have to multiply the hours by 3600 (seconds per hour).
>>
>>HTH, Hilmar.
>
>So true...but how do I get the time-zone offset?
>Unless intoxicated, I usually know where I am, but I dont know where in the world the software is running :-))

Oh, sorry. It wasn't clear, to me at least, what exactly you were missing.

You can ask for user input, of course, but I don't think you want that.

You can get the timezone, as specified in the Control Panel, with the Windows API, but I don't remember any further details. This was discussed a few weeks ago, here on the UT.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform