C++/how to get system date
can u teach me the easiest way on how to get the system date? Is there a predefined function to perform this function?
I need the date to calculate the days elapsed to award interest for customers in a bank account system. This is my college assignment. Your help would be greatly appreciated. Thanks.
I am using Dev 126.96.36.199 C++ compiler
Hello Nick, thank you for the question.
Sure, there is a predefined function to do this for you. It is called time() and is located in <time.h>. It takes a structure called a time_t as a parameter by pointer and fills it out with the system time. It does it kind of weird though, so I suggest you read the MSDN documentation on it, which can be found here:
There is also a function called localtime() which can convert timezones for you. I hope this answers your question.
I hope this information was helpful.