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:
parent
c729387ab6
commit
60267ab952
@ -37,7 +37,7 @@ using ::std::chrono::floor;
|
|||||||
using ::date::floor;
|
using ::date::floor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int DateTime(int, char* [])
|
int DateTime(int, char*[])
|
||||||
{
|
{
|
||||||
MockDb db = {};
|
MockDb db = {};
|
||||||
MockDb::_serializer_context_t printer = {};
|
MockDb::_serializer_context_t printer = {};
|
||||||
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user