From 61f4a460fa3fb297b056597353e2e2f3330db7b3 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 22 Jul 2011 14:56:17 +0200 Subject: Corrections to PostgreSQL traits implementation in mapping example --- mapping/traits-pgsql.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mapping/traits-pgsql.hxx') diff --git a/mapping/traits-pgsql.hxx b/mapping/traits-pgsql.hxx index e196321..0b43c71 100644 --- a/mapping/traits-pgsql.hxx +++ b/mapping/traits-pgsql.hxx @@ -10,7 +10,7 @@ // #include -#include +#include // localtime, mktime, time_t, tm #include #include @@ -91,7 +91,7 @@ namespace odb // tm v_tm (*localtime (&v_tt)); - v = date (v_tm.tm_year + 1900, v_tm.tm_mon, v_tm.tm_mday); + v = date (v_tm.tm_year + 1900, v_tm.tm_mon + 1, v_tm.tm_mday); } static void @@ -100,10 +100,10 @@ namespace odb is_null = false; tm v_tm; - memset (&v_tm, 0, sizeof (v_tm)); + std::memset (&v_tm, 0, sizeof (v_tm)); v_tm.tm_mday = v.day (); - v_tm.tm_mon = v.month (); + v_tm.tm_mon = v.month () - 1; v_tm.tm_year = v.year () - 1900; time_t v_tt (mktime (&v_tm)); -- cgit v1.1