aboutsummaryrefslogtreecommitdiff
path: root/boost/pgsql/date-time
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-12-04 23:33:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-12-05 11:29:56 +0200
commitf333016241010d32224e671006dfcd47c9e4be9e (patch)
tree798076a115963ba7472456ebbcf4fbaf55ac4f0b /boost/pgsql/date-time
parent8bba70a624cc79f6c0a8b29009f9b8d05e906b2a (diff)
Test updated PostgreSQL date-time mappings which handle microsecond resolutions
Diffstat (limited to 'boost/pgsql/date-time')
-rw-r--r--boost/pgsql/date-time/driver.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/boost/pgsql/date-time/driver.cxx b/boost/pgsql/date-time/driver.cxx
index d261add..6827bd6 100644
--- a/boost/pgsql/date-time/driver.cxx
+++ b/boost/pgsql/date-time/driver.cxx
@@ -50,24 +50,20 @@ main (int argc, char* argv[])
o.dates.push_back (date (max_date_time));
o.dates.push_back (date (min_date_time));
- o.times.push_back (second_clock::local_time ());
+ o.times.push_back (microsec_clock::local_time ());
o.times.push_back (not_a_date_time);
o.times.push_back (pos_infin);
o.times.push_back (neg_infin);
-
- // Boost seems to handle 64 bit std::time_t incorrectly.
- // Insert 32 bit minimum and maximum UNIX time values for now.
- //
- // o.times.push_back (date (max_date_time));
- // o.times.push_back (date (min_date_time));
- //
-
- o.times.push_back (ptime (date (1901, 12, 14), time_duration (0, 0, 0)));
- o.times.push_back (ptime (date (2038, 1, 19), time_duration (3, 14, 7)));
+ o.times.push_back (ptime (date (max_date_time),
+ time_duration (16, 23, 0, 123456)));
+ o.times.push_back (ptime (date (min_date_time),
+ time_duration (3, 14, 7, 123456)));
+ o.times.push_back (ptime (date (1969, 12, 31), // Before PG epoch.
+ time_duration (23, 59, 59, 123000)));
o.durations.push_back (time_duration (0, 0, 0));
- o.durations.push_back (time_duration (12, 3, 4));
- o.durations.push_back (time_duration (23, 59, 59));
+ o.durations.push_back (time_duration (12, 3, 4, 123456));
+ o.durations.push_back (time_duration (23, 59, 59, 123456));
o.durations.push_back (not_a_date_time);
{