Jump to content

Time function


Guest filo

Recommended Posts

http://www.cplusplus.com/reference/clibrary/ctime/

time(NULL) is just the number of seconds since the UNIX epoch (12:00 AM Jan 1st 1970)

Using time.h, you can do something like:

time_t timestamp;
time(&timestamp);

tm* timeinfo;
timeinfo = localtime(&timestamp);

timeinfo->tm_sec = 0;
timeinfo->tm_min = 0;
timeinfo->tm_hour = 15;

timestamp = mktime(timeinfo);

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use