aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-03-30 20:47:38 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-01 13:10:06 +0300
commit0598a6d315ecadc5dd58cd8f5dde7c603c3f493c (patch)
treefa24de8d71bb6501d889956878666674d44adda7 /tests
parent34466f10506fd57836e89cffda7738c3008321b1 (diff)
Add daytime() function
Diffstat (limited to 'tests')
-rw-r--r--tests/timestamp/driver.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/timestamp/driver.cxx b/tests/timestamp/driver.cxx
index 1746c2e..11e1821 100644
--- a/tests/timestamp/driver.cxx
+++ b/tests/timestamp/driver.cxx
@@ -225,4 +225,16 @@ main ()
assert (parse (
"Apr 8 19:31:10 2016", "%b %d %H:%M:%S %Y", "Apr 08 19:31:10 2016"));
+
+ {
+ timestamp t (from_string ("Apr 8 19:31:10 2016",
+ "%b %d %H:%M:%S %Y",
+ true /* local */));
+
+ timestamp mt (from_string ("Apr 8 00:00:00 2016",
+ "%b %d %H:%M:%S %Y",
+ true /* local */));
+
+ assert (daytime (t) == t - mt);
+ }
}