answersLogoWhite

0


Best Answer

#include <iostream>

#include <ctime>

using namespace std;

int main()

{

time_t rawtime;

struct TM *timeinfo;

while(true)

{

time(&rawtime);

timeinfo = localtime(&rawtime);

cout << "Current local time & date: " << asctime(timeinfo) << endl;

system("cls");

}

return 0;

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Setting the time is not a C++ thing, per se. It is a library function, and it depends on the particular platform.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C plus plus program to find the current time?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Program to get a system time using c plus plus?

time in hours second minute


What are the x factor competition questions?

The questions change all the time. Watch the current program to find out the competition question and details.


What are the differences of turbo c plus plus and mother program?

No idea what mother program is, but I assume you mean how does Turbo C++ compare to the ISO C++ standard. The last version of Turbo C++ came out in 2006 and was compliant with the standard at that time. However, Embarcadero (the current owners) no longer support Turbo C++, thus it no longer complies with the current ISO standard.


When is it time to adjust your FITT formula levels?

When your body adjusts to your current exercise program.


What is debugging in c plus plus?

Debugging is a way of running the program to locate any errors that may arise at run-time.


How do you find execution time of a program in java?

You can have the below line as the first and last line of the program and find out the difference in time taken to calculate the execution time. This will print the system time in the console which can be used to calculate execution time.System.currentTimeMillis();


Do Goodyear tire stores have a rewards program for frequent buyers?

Goodyear tire stores have a rewards program called Goodyear Rewards Plus that is for sellers, not buyers. There is not a frequent buyers program at this time.


Can virtual program with all physics and chemical formulas help to create time machine?

No. Not with the current understanding of science.


Where can one go to find the current time in New York?

One can find the current time in the state of New York through a variety of phone apps, as well as from visiting websites run by companies such as World Time Server.


How do you put a time limit on a certain PC account?

to put a time limet on a certain account you need this program i dont know the name of the program but u can find it


Where would you find real time current information everything about the where and when of Justin Bieber and others?

You can use Google Real Time Search for current updates and informations.


Where can one find the current time in Washington?

The current time in Washington can be located different ways. The time can be found on the internet. You can also purchase a watch with different time zones in it and set one for Washington.