Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

VFP 9 Current Time for Time Zone

Posted on 2013-01-19
4
955 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 29

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 42

Assisted Solution

by:pcelba
pcelba earned 333 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 42

Assisted Solution

by:pcelba
pcelba earned 333 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 167 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

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…
ConnectWise and their customers need to ensure critical alerts automatically reach the right person at the right time. MSP superheros efficiently respond to these alerts key is providing automatic, intelligent alerting that generates a complete audi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

860 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