Local TIme on form

mdg

Registered User.
Local time
Today, 06:43
Joined
Feb 17, 2011
Messages
68
I have a form that displays various cities information for my firm. Each record is a different city and the form displays information for that particular area from a querry and users can input/update this info. I would like to show the local time for that city somewhere on the form. (I would also like to show some simple weather data too but that can wait for now.) Thanks.
 
I you have now the time offset between the city in question and the local time you can use DateAdd() function to calculate local time for each city
 
Thanks for your kind reply. I am not sure that date function by itslelf will do the trick but I will play around with it some. I'm thinking I may need a macro or something listing all the cities with their respective time differences somehow, but I don't know how to begin doing so.. I guess I can always not include the time feature and just have a memo to look at a clock nearby. Ha..
 
Don't be mislead by the fact that the function is called DateAdd it will work for pure time data, as time and date are related and stored in the same format. This function will do what you are after.
 
You can get the computers time zone (GMT offset bias) from the registry

Goto HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\Bias

Use a simple read registry function to get the offset for that computer and use that to add or subtract the bias from the local time.
 
Thanks for all the input. I will work on those suggestions today. Just got in.
 

Users who are viewing this thread

Back
Top Bottom