+ 2
Is there any code to find the current date and time of the system ...in c++
date/time in c++
9 Answers
+ 7
That is OS dependant....but for Windows you can use QueryPerformanceCounter().
+ 6
#include <windows.h>
LARGE_INTEGER freq, t1,t2;
QueryPerformanceFrequency((LARGE_INTEGER*)&freq);
QueryPerformanceCounter((LARGE_INTEGER*)&t1);
QueryPerformanceCounter((LARGE_INTEGER*)&t2);
double elapsedTime= (double) ((t2.QuadPart - t1.QuadPart) / freq.QuadPart);
+ 5
I've just posted the minimum code, I can't put the entire Windows code here it is way too long.
+ 5
main() is a console application, not windows.
+ 1
I used this code
void printbuilddatetime(){
cout<<__TIMESTAMP__<<endl;
}
int main()
{
printbuilddatetime();
}
0
I am using dev c++ GUI environment..
0
can you please write the full code of this!
0
it is not working. ....
0
you are right....... thanks for the code...