#include <iostream>
#include <string>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/lexical_cast.hpp>

std::string
DateEx(
    const std::string& dstr,
    int                sec
    )
{
  using namespace boost::posix_time;
  return boost::lexical_cast<std::string>(
      ptime(dstr.empty() ? second_clock::local_time()
                         : time_from_string(dstr)
      ) + seconds(sec)
    );
}

int main(int c, char** v)
{
  if ( c == 1 ) {
    std::cout << "usage: " << v[0] << " [<datetime{YYYY-Mon-DD hh:mm:ss}>] <seconds>\n";
    return 0;
  }

  std::cout << DateEx(
      c>=3?v[1]:"",
      boost::lexical_cast<int>(c>=3?v[2]:v[1])
      ) << "\n";

  return 0;
}
