Tracking the time w/c++
Ok, i'm trying to write a quick program that will grab the time now and then keep track of how many hours it's been since the time was first grabbed up to a certain # of hours.
My plan is to have the program store the time in an ini file for access later. All I need to know though is how to make C++ understand what time it is now, and the next time I open the program, how many hours it's been since I grabbed the initial time, in 30 minute increments if possible.
Any tips / links to tutorials / guidance is appreciated.
Thanks in advance
You could consider using time() from <ctime>. The FAQ says something about Working with dates and times.
Take a look at the date & time FAQ.
Thanks a lot to both of you! Good info there.
In addition, Boost has a Date_Time library that makes working with dates and times a lot easier.