Jump to content
  • Advertisement

Archived

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

DevLiquidKnight

Getting system time..

This topic is 5686 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
Advertisement
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);
sprintf(szBuff,"%02d:%02d:%02d",pTime->tm_hour,pTime->tm_min,pTime->tm_sec);
return szBuff;
}


HTH,
Steve

Steve
DirectX Programmer
Soon to be the new Bill Gates

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!