Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ctime question

Status
Not open for further replies.

rtnMichael

Programmer
Aug 5, 2002
152
US
Hey guys, if I wanted to get the current time in seconds, how would I do it with Ctime....or maybe I don't even use Ctime. I want to delete files after a certain time limit and I do a stat on the file and it gives me it's creation time in seconds (I believe ;o)), so I need to get this current time and compare them. I need the time in seconds only.

Thanks
Mike
 
Use time_t tnow = time(0) from C++ Std <ctime> == seconds from 1970-01-01T00:00:00. Check your file time seconds epoch (must be the same null point!). Excelsior!..
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top