Tuesday, July 28, 2009

Turbo C problem?

How to write a program on finding out the time of any particular country?


Like if the user wants to know the time of India at that moment so the output is the time of India.


The whole thing is that how to add this time thing in a program ?Thanks.

Turbo C problem?
Visit this website for international time clock.





http://www.timeanddate.com/worldclock





You can get a Widget that have it if you search for it.
Reply:List all the time zones.





All 24 or 27. Something like that.





From Greenwich Mean time add by 1 hour to the corresponding cities and/or countries. (i++)





You could use your time zone as a reference point. But the down side is if you send your program to someone in another TZ (time zone) it'll be off.





I'd reference Greenwich Mean and work from there.
Reply:You can use time.h header file and from the below links you will get the idea for it where as Time Zone values can be fetch from time.h header File





check this site for better View
Reply:First get current system time.


#include %26lt;iostream%26gt;


#include %26lt;ctime%26gt; // If you're using C, replace that with time.h


using namespace std;


int main()





{


time_t date; // Make a time_t object that'll hold the date


time(%26amp;date); // Set the date variable to the current date


cout %26lt;%26lt; "The date and Time: " %26lt;%26lt; ctime(%26amp;date) %26lt;%26lt; endl;


system("pause");


return 0;


}





Then make a table where u convert time between countries like if u compare between countries what is the time difference between them. Use switch statement to get user select between countries and do calculation and display results in same labeled step


No comments:

Post a Comment