From 0598a6d315ecadc5dd58cd8f5dde7c603c3f493c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 30 Mar 2020 20:47:38 +0300 Subject: Add daytime() function --- tests/timestamp/driver.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') 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); + } } -- cgit v1.1