Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VFP 9 Current Time for Time Zone

Posted on 2013-01-19
4
Medium Priority
?
1,047 Views
Last Modified: 2013-07-14
Hi all. I'm using VFP 9 SP1.

On a form I need the time and time zone displayed for my PC.

Next to the time display I need a drop-down that lists all available time zones. When a timezone is selected, the time displayed changes to the correct CURRENT time for that zone.

For example, I'm in CST. My PC clock shows 6:00 PM here. From the drop-down I select EST. The time displayed on the form should then show 5:00 PM and EST as the time zone.

However, since I believe daylight savings occurs at different times in different zones, it can't be a simple (take my time and subtract one hour). It would have to be some sort of lookup that actually checks to see what time it is in the new time zone. I hope that makes sense.

I realize this is probably difficult to implement in fp, but I am being told this is a must-have, and I'm not even sure where to begin.

Thanks!!!
0
Comment
Question by:formadmirer
  • 2
4 Comments
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 38796284
This should get you started: http://www.news2news.com/vfp/?example=73&function=106

Bye, Olaf.
0
 
LVL 43

Assisted Solution

by:pcelba
pcelba earned 1332 total points
ID: 38796337
MS solved this already: http://support.microsoft.com/kb/194576

Google is even more helpful: http://www.google.com/#hl=cs&tbo=d&sclient=psy-ab&q=time+zone+foxpro&oq=time+zone+foxpro&gs_l=hp.3..0i8i30.1619.4147.0.4797.16.14.0.2.2.0.231.1691.5j8j1.14.0...0.0...1c.1.ns2qN7txidM&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&bvm=bv.41248874,d.d2k&fp=b61c7fb1a1fb209e&biw=1195&bih=601

This MSDN article (and links inside) can say more about time zones in Windows: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724421(v=vs.85).aspx

To obtain the right time zone for your current location is almost impossible. You could derive it for computer IP but some networks topology is spread over several time zones. Wikipedia can help: http://en.wikipedia.org/wiki/List_of_time_zones_by_U.S._state

Daylight saving data are changed every year and you'll need to update them continuously. A good start is e.g. here: http://en.wikipedia.org/wiki/Daylight_saving_time
http://en.wikipedia.org/wiki/Daylight_saving_time_in_the_United_States
0
 
LVL 43

Assisted Solution

by:pcelba
pcelba earned 1332 total points
ID: 38796352
And the final solution: Based on your computer settings and the selected Time zone you have to calculate the difference between your computer time and the selected Time zone. You may add this difference to the DATETIME() and display the result on your form which has to be updated every second in some Timer event.

You could also think about internet atomic clock time and calculate the difference against it. More info is here: http://fox.wikis.com/wc.dll?Wiki~GetAtomicClockServerTime
0
 
LVL 12

Accepted Solution

by:
jrbbldr earned 668 total points
ID: 38796410
And if you have a MS SQL Server running you can just query the time and offset bias from it

Good Luck
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Aerodynamic noise is the cause of the majority of the noise produced by helicopters. The inordinate amount of noise helicopters produce is a major problem in the both a military and civilian setting. To remedy this problem the use of an aerogel coat…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question