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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date manipulation 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How can we obtain the current date and add say 7 or 85 days to it? Is there a add function for date????
 
sure,
#include <time.h>
#define HOUR 60*60
#define DAYS HOUR * 24

....
....

log now;
time(&now);
now += 5 * DAYS + 3 * HOUR;
printf(&quot;%s\n&quot;,ctime(&now));

/*
this is ONE possible variant to do that!
*/
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top