//字符串转时间 DateTimeParser::parse
//时间转字符串 DateTimeFormatter::format
//时间与整数转换 Timestamp
//1整数转换成时间字符串
cout << "int to string" << endl;
Poco::Timestamp ts = Poco::Timestamp::fromEpochTime(1516239022);
std::string str = DateTimeFormatter::format(ts, DateTimeFormat::SORTABLE_FORMAT);
cout << str << endl;
//2.时间字符串转整数
cout << "string to int" << endl;
int tzd;
DateTime dt = DateTimeParser::parse(DateTimeFormat::SORTABLE_FORMAT, "2018-01-18 01:30:22", tzd);
cout << dt.timestamp().epochTime() << endl;
//2.localdata时间时间转换成string
LocalDateTime now;
std::string str2 = DateTimeFormatter::format(now, DateTimeFormat::SORTABLE_FORMAT);
cout << str2 << endl;