How do I get Windows Date & Time

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
1
2
SYSTEMTIME time;
GetLocalTime(&time);



You cant get the two seperetly. Cheers.
GetSystemTime
Perfect. Thank you.
Topic archived. No new replies allowed.