How do I get Windows Date & Time

Aug 27, 2009 at 2:11am
I'm not too familiar with WIN32. I have an ErrorLog where everytime an error is thrown, I need to grab the system date and time and write it to log.txt before I write the actual error that has occurred What windows function would get the job done most effectively? Also, how can I get the date and time separately?

Thanks,
Return 0;
Last edited on Aug 27, 2009 at 2:15am
Aug 27, 2009 at 7:41am
1
2
SYSTEMTIME time;
GetLocalTime(&time);



You cant get the two seperetly. Cheers.
Aug 27, 2009 at 11:50am
GetSystemTime
Aug 27, 2009 at 2:20pm
Perfect. Thank you.
Topic archived. No new replies allowed.