Advertisement Jump to content


This topic is now archived and is closed to further replies.


Getting system time..

This topic is 5927 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to figure out how does one go about getting the system time on a computer. I am not using MFC I need to do this in my game because I will be using it deteramin if the world should be night or day. Anyone know how I could do this? Like just the basic info for getting system time. Perferaly not just some number that is used to deteramin time... But to actually find out if it is 2:30 Don''t click me! Killer Eagle Software

Share this post

Link to post
Share on other sites
Here''s my exact code for getting the system time (from my CGI proggy: )

char* GetTime(char* szBuff)
time_t theTime;
tm* pTime;

theTime = time(NULL);
pTime = localtime(&theTime);
return szBuff;


DirectX Programmer
Soon to be the new Bill Gates

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!