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

@ -37,7 +37,7 @@ using ::std::chrono::floor;
using ::date::floor;
#endif
int DateTime(int, char* [])
int DateTime(int, char*[])
{
MockDb db = {};
MockDb::_serializer_context_t printer = {};
@ -51,6 +51,8 @@ int DateTime(int, char* [])
{
std::cout << row.colDayPoint;
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();
std::cerr << serialize(::sqlpp::value(std::chrono::system_clock::now()), printer).str() << std::endl;