0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Added an example for reading time point values

This commit is contained in:
rbock 2019-04-18 08:54:17 +02:00
parent c729387ab6
commit 60267ab952

View File

@ -51,6 +51,8 @@ int DateTime(int, char* [])
{ {
std::cout << row.colDayPoint; std::cout << row.colDayPoint;
std::cout << row.colTimePoint; std::cout << row.colTimePoint;
const auto tp = std::chrono::system_clock::time_point{row.colTimePoint.value()};
std::cout << std::chrono::system_clock::to_time_t(tp);
} }
printer.reset(); printer.reset();
std::cerr << serialize(::sqlpp::value(std::chrono::system_clock::now()), printer).str() << std::endl; std::cerr << serialize(::sqlpp::value(std::chrono::system_clock::now()), printer).str() << std::endl;