boost ver: 1.55.0
#include <iostream>
#include "boost/date_time/posix_time/posix_time.hpp"
int main()
{
using namespace boost::posix_time;
time_facet *f = new time_facet("%Y-%m-%d %H:%M:%S");
std::ostringstream oss;
oss.imbue(std::locale(oss.getloc(), f));
ptime now = second_clock::local_time();
oss << now;
std::cout << oss.str() << std::endl;
}