C++ add 1 year to date
问题 This is how im generating my date i want to add 1 year to it. Thanks in advance. char tmpbuf[128]; time_t ltime; struct tm *today; stringstream reD; string todayDate; time( <ime ); today = localtime( <ime ); strftime( tmpbuf, 128,"%Y-%m-%d_%H:%M:%S", today ); reD << tmpbuf; reD >> todayDate; boost::replace_all(todayDate, "_", " "); cout << todayDate << endl; OK ive decided to go with boost since it will be easier to add days, so 2 examples i need one to add 1 year, and one to add 14 days,