Sign in to follow this  
johnnyBravo

How to get the current time in c++?

Recommended Posts

Dragoncar    517

#include <time.h>

void somefunc()
{
time_t time;
/*some structure pointer I can't remember the name of*/ timeS;
int hour;
int min;
int sec;

time = time(0);
timeS = currentTime(&time);

hour = timeS->hour;
min = timeS->min;
sec = timeS->sec;
}



Note: this is probably not the best way to do it

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this