diff options
Diffstat (limited to 'mapping/traits-pgsql.hxx')
-rw-r--r-- | mapping/traits-pgsql.hxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mapping/traits-pgsql.hxx b/mapping/traits-pgsql.hxx index 6ee396d..92ce4c4 100644 --- a/mapping/traits-pgsql.hxx +++ b/mapping/traits-pgsql.hxx @@ -74,6 +74,9 @@ namespace odb return; } + tm pg_epoch_tm = {0, 0, 0, 1, 1, 100, 0, 0, 0, 0, 0}; + time_t pg_epoch_tt (mktime (&pg_epoch_tm)); + time_t v_tt (pg_epoch_tt + static_cast<time_t> (details::endian_traits::ntoh (i)) * seconds_per_day); @@ -97,6 +100,9 @@ namespace odb time_t v_tt (mktime (&v_tm)); + tm pg_epoch_tm = {0, 0, 0, 1, 1, 100, 0, 0, 0, 0, 0}; + time_t pg_epoch_tt (mktime (&pg_epoch_tm)); + i = details::endian_traits::hton ( static_cast<int> ((v_tt - pg_epoch_tt) / seconds_per_day)); } |