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 Chriss Miller 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
Joined
Jan 1, 1970
Messages
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

Replies
1
Views
222
  • Locked
  • Question Question
Replies
1
Views
191
  • Locked
  • Question Question
Replies
2
Views
130
Replies
2
Views
235

Part and Inventory Search

Sponsor

Back
Top