diff --git a/src/util/detail/monotonic-deadline-timer.hpp b/src/util/detail/monotonic-deadline-timer.hpp
deleted file mode 100644
index 002912c..0000000
--- a/src/util/detail/monotonic-deadline-timer.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-/**
- * This code is based on https://svn.boost.org/trac/boost/attachment/ticket/3504/MonotonicDeadlineTimer.h
- */
-
-#ifndef NDN_UTIL_DETAIL_MONOTONIC_DEADLINE_TIMER_HPP
-#define NDN_UTIL_DETAIL_MONOTONIC_DEADLINE_TIMER_HPP
-
-#include "../time.hpp"
-#include <boost/asio/basic_deadline_timer.hpp>
-#include <boost/asio/io_service.hpp>
-
-namespace boost {
-namespace asio {
-
-template<>
-struct time_traits<ndn::time::steady_clock>
-{
-  using time_type     = ndn::time::steady_clock::TimePoint;
-  using duration_type = ndn::time::steady_clock::Duration;
-
-  static time_type
-  now()
-  {
-    return ndn::time::steady_clock::now();
-  }
-
-  static time_type
-  add(const time_type& time, const duration_type& duration)
-  {
-    return time + duration;
-  }
-
-  static duration_type
-  subtract(const time_type& timeLhs, const time_type& timeRhs)
-  {
-    return timeLhs - timeRhs;
-  }
-
-  static bool
-  less_than(const time_type& timeLhs, const time_type& timeRhs)
-  {
-    return timeLhs < timeRhs;
-  }
-
-  static boost::posix_time::time_duration
-  to_posix_duration(const duration_type& duration)
-  {
-    return ndn::time::steady_clock::to_posix_duration(duration);
-  }
-};
-
-} // namespace asio
-} // namespace boost
-
-namespace ndn {
-namespace util {
-namespace detail {
-
-class MonotonicDeadlineTimer : public boost::asio::basic_deadline_timer<time::steady_clock>
-{
-public:
-  MonotonicDeadlineTimer(boost::asio::io_service& ioService)
-    : boost::asio::basic_deadline_timer<time::steady_clock>(ioService)
-  {
-  }
-};
-
-} // namespace detail
-} // namespace util
-} // namespace ndn
-
-#endif // NDN_UTIL_DETAIL_MONOTONIC_DEADLINE_TIMER_HPP
diff --git a/src/util/detail/steady-timer.hpp b/src/util/detail/steady-timer.hpp
new file mode 100644
index 0000000..4fb4e27
--- /dev/null
+++ b/src/util/detail/steady-timer.hpp
@@ -0,0 +1,60 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_UTIL_DETAIL_STEADY_TIMER_HPP
+#define NDN_UTIL_DETAIL_STEADY_TIMER_HPP
+
+#include "../time.hpp"
+
+#include <boost/asio/basic_waitable_timer.hpp>
+#include <boost/asio/wait_traits.hpp>
+
+namespace boost {
+namespace asio {
+
+template<>
+struct wait_traits<ndn::time::steady_clock>
+{
+  static ndn::time::steady_clock::duration
+  to_wait_duration(const ndn::time::steady_clock::duration& d)
+  {
+    return ndn::time::steady_clock::to_wait_duration(d);
+  }
+};
+
+} // namespace asio
+} // namespace boost
+
+namespace ndn {
+namespace util {
+namespace detail {
+
+class SteadyTimer : public boost::asio::basic_waitable_timer<time::steady_clock>
+{
+public:
+  using boost::asio::basic_waitable_timer<time::steady_clock>::basic_waitable_timer;
+};
+
+} // namespace detail
+} // namespace util
+} // namespace ndn
+
+#endif // NDN_UTIL_DETAIL_STEADY_TIMER_HPP
diff --git a/src/util/notification-subscriber.cpp b/src/util/notification-subscriber.cpp
index 56dee40..66ffd8c 100644
--- a/src/util/notification-subscriber.cpp
+++ b/src/util/notification-subscriber.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016 Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018 Regents of the University of California,
  *                         Arizona Board of Regents,
  *                         Colorado State University,
  *                         University Pierre & Marie Curie, Sorbonne University,
@@ -28,6 +28,8 @@
 #include "notification-subscriber.hpp"
 #include "random.hpp"
 
+#include <cmath>
+
 namespace ndn {
 namespace util {
 
@@ -186,8 +188,8 @@
 
   m_lastNackSequenceNo = nackSequenceNo;
 
-  return time::milliseconds(static_cast<uint32_t>(pow(2, m_attempts) * 100 +
-                                                  random::generateWord32() % 100));
+  return time::milliseconds(static_cast<time::milliseconds::rep>(std::pow(2, m_attempts) * 100 +
+                                                                 random::generateWord32() % 100));
 }
 
 } // namespace util
diff --git a/src/util/scheduler.cpp b/src/util/scheduler.cpp
index 3170f61..167b6e0 100644
--- a/src/util/scheduler.cpp
+++ b/src/util/scheduler.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -20,7 +20,7 @@
  */
 
 #include "scheduler.hpp"
-#include "detail/monotonic-deadline-timer.hpp"
+#include "detail/steady-timer.hpp"
 
 #include <boost/scope_exit.hpp>
 
@@ -76,7 +76,7 @@
 }
 
 Scheduler::Scheduler(boost::asio::io_service& ioService)
-  : m_deadlineTimer(make_unique<detail::MonotonicDeadlineTimer>(ioService))
+  : m_timer(make_unique<detail::SteadyTimer>(ioService))
   , m_isEventExecuting(false)
 {
 }
@@ -108,7 +108,7 @@
   }
 
   if (info->queueIt == m_queue.begin()) {
-    m_deadlineTimer->cancel();
+    m_timer->cancel();
   }
   m_queue.erase(info->queueIt);
 
@@ -121,15 +121,15 @@
 Scheduler::cancelAllEvents()
 {
   m_queue.clear();
-  m_deadlineTimer->cancel();
+  m_timer->cancel();
 }
 
 void
 Scheduler::scheduleNext()
 {
   if (!m_queue.empty()) {
-    m_deadlineTimer->expires_from_now((*m_queue.begin())->expiresFromNow());
-    m_deadlineTimer->async_wait(bind(&Scheduler::executeEvent, this, _1));
+    m_timer->expires_from_now((*m_queue.begin())->expiresFromNow());
+    m_timer->async_wait(bind(&Scheduler::executeEvent, this, _1));
   }
 }
 
@@ -148,9 +148,9 @@
   } BOOST_SCOPE_EXIT_END
 
   // process all expired events
-  time::steady_clock::TimePoint now = time::steady_clock::now();
+  auto now = time::steady_clock::now();
   while (!m_queue.empty()) {
-    EventQueue::iterator head = m_queue.begin();
+    auto head = m_queue.begin();
     shared_ptr<EventInfo> info = *head;
     if (info->expireTime > now) {
       break;
diff --git a/src/util/scheduler.hpp b/src/util/scheduler.hpp
index 6d04bd1..79fbf23 100644
--- a/src/util/scheduler.hpp
+++ b/src/util/scheduler.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -25,13 +25,14 @@
 #include "time.hpp"
 #include "../net/asio-fwd.hpp"
 
+#include <boost/system/error_code.hpp>
 #include <set>
 
 namespace ndn {
 namespace util {
 
 namespace detail {
-class MonotonicDeadlineTimer;
+class SteadyTimer;
 } // namespace detail
 
 namespace scheduler {
@@ -163,7 +164,7 @@
   executeEvent(const boost::system::error_code& code);
 
 private:
-  unique_ptr<detail::MonotonicDeadlineTimer> m_deadlineTimer;
+  unique_ptr<detail::SteadyTimer> m_timer;
   EventQueue m_queue;
   bool m_isEventExecuting;
 };
diff --git a/src/util/segment-fetcher.cpp b/src/util/segment-fetcher.cpp
index c8075e7..0d54915 100644
--- a/src/util/segment-fetcher.cpp
+++ b/src/util/segment-fetcher.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -26,6 +26,7 @@
 #include "../lp/nack-header.hpp"
 
 #include <boost/lexical_cast.hpp>
+#include <cmath>
 
 namespace ndn {
 namespace util {
@@ -162,7 +163,8 @@
         reExpressInterest(origInterest, reExpressCount, self);
         break;
       case lp::NackReason::CONGESTION:
-        m_scheduler.scheduleEvent(time::milliseconds(static_cast<uint32_t>(pow(2, reExpressCount + 1))),
+        using ms = time::milliseconds;
+        m_scheduler.scheduleEvent(ms(static_cast<ms::rep>(std::pow(2, reExpressCount + 1))),
                                   bind(&SegmentFetcher::reExpressInterest, this,
                                        origInterest, reExpressCount, self));
         break;
diff --git a/src/util/time-custom-clock.hpp b/src/util/time-custom-clock.hpp
index 57579e5..43d525c 100644
--- a/src/util/time-custom-clock.hpp
+++ b/src/util/time-custom-clock.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_TIME_CUSTOM_CLOCK_HPP
-#define NDN_TIME_CUSTOM_CLOCK_HPP
+#ifndef NDN_UTIL_TIME_CUSTOM_CLOCK_HPP
+#define NDN_UTIL_TIME_CUSTOM_CLOCK_HPP
 
 #include "time.hpp"
 
@@ -46,12 +46,12 @@
   virtual std::string
   getSince() const = 0;
 
-  virtual boost::posix_time::time_duration
-  toPosixDuration(const typename BaseClock::duration& duration) const = 0;
+  virtual typename BaseClock::duration
+  toWaitDuration(typename BaseClock::duration d) const = 0;
 };
 
-typedef CustomClock<system_clock> CustomSystemClock;
-typedef CustomClock<steady_clock> CustomSteadyClock;
+using CustomSystemClock = CustomClock<system_clock>;
+using CustomSteadyClock = CustomClock<steady_clock>;
 
 /**
  * \brief Set custom system and steady clocks
@@ -66,4 +66,4 @@
 } // namespace time
 } // namespace ndn
 
-#endif // NDN_TIME_CUSTOM_CLOCK_HPP
+#endif // NDN_UTIL_TIME_CUSTOM_CLOCK_HPP
diff --git a/src/util/time-unit-test-clock.cpp b/src/util/time-unit-test-clock.cpp
index 58e1f03..0e34756 100644
--- a/src/util/time-unit-test-clock.cpp
+++ b/src/util/time-unit-test-clock.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -20,78 +20,75 @@
  */
 
 #include "time-unit-test-clock.hpp"
-#include "detail/monotonic-deadline-timer.hpp"
+#include "detail/steady-timer.hpp"
+
+#include <chrono>
 #include <thread>
 
 namespace ndn {
 namespace time {
 
-const std::chrono::microseconds SLEEP_AFTER_TIME_CHANGE(2);
-
-template<class BaseClock>
-UnitTestClock<BaseClock>::UnitTestClock(const nanoseconds& startTime)
+template<class BaseClock, class ClockTraits>
+UnitTestClock<BaseClock, ClockTraits>::UnitTestClock(nanoseconds startTime)
   : m_currentTime(startTime)
 {
 }
 
-template<class BaseClock>
+template<class BaseClock, class ClockTraits>
 std::string
-UnitTestClock<BaseClock>::getSince() const
+UnitTestClock<BaseClock, ClockTraits>::getSince() const
 {
-  return " since unit test clock advancements";
+  return " since unit test beginning";
 }
 
-template<class BaseClock>
+template<class BaseClock, class ClockTraits>
 typename BaseClock::time_point
-UnitTestClock<BaseClock>::getNow() const
+UnitTestClock<BaseClock, ClockTraits>::getNow() const
 {
   return typename BaseClock::time_point(duration_cast<typename BaseClock::duration>(m_currentTime));
 }
 
-template<class BaseClock>
-boost::posix_time::time_duration
-UnitTestClock<BaseClock>::toPosixDuration(const typename BaseClock::duration& duration) const
+template<class BaseClock, class ClockTraits>
+typename BaseClock::duration
+UnitTestClock<BaseClock, ClockTraits>::toWaitDuration(typename BaseClock::duration) const
 {
-  return
-#ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
-    boost::posix_time::nanoseconds(1)
-#else
-    boost::posix_time::microseconds(1)
-#endif
-    ;
+  return typename BaseClock::duration(1);
 }
 
-
-template<class BaseClock>
+template<class BaseClock, class ClockTraits>
 void
-UnitTestClock<BaseClock>::advance(const nanoseconds& duration)
+UnitTestClock<BaseClock, ClockTraits>::advance(nanoseconds duration)
 {
   m_currentTime += duration;
 
-  // On some platforms, boost::asio::io_service for deadline_timer (e.g., the one used in
-  // Scheduler) will call time_traits<>::now() and will "sleep" for
-  // time_traits<>::to_posix_time(duration) period before calling time_traits<>::now()
-  // again. (Note that such "sleep" will occur even if there is no actual waiting and
-  // program is calling io_service.poll().)
+  // When UnitTestClock is used with Asio timers (e.g. basic_waitable_timer), and
+  // an async wait operation on a timer is already in progress, Asio won't look
+  // at the clock again until the earliest timer has expired, so it won't know that
+  // the current time has changed.
   //
-  // As a result, in order for the clock advancement to be effective, we must sleep for a
-  // period greater than time_traits<>::to_posix_time().
+  // Therefore, in order for the clock advancement to be effective, we must sleep
+  // for a period greater than wait_traits::to_wait_duration().
   //
-  // See also http://blog.think-async.com/2007/08/time-travel.html
-  BOOST_ASSERT(boost::posix_time::microseconds(SLEEP_AFTER_TIME_CHANGE.count()) >
-               boost::asio::time_traits<steady_clock>::to_posix_duration(duration));
-  std::this_thread::sleep_for(SLEEP_AFTER_TIME_CHANGE);
+  // See also http://blog.think-async.com/2007/08/time-travel.html - "Jumping Through Time"
+  //
+  std::this_thread::sleep_for(std::chrono::nanoseconds(duration_cast<nanoseconds>(
+                                boost::asio::wait_traits<steady_clock>::to_wait_duration(duration) +
+                                typename BaseClock::duration(1)).count()));
 }
 
-template<class BaseClock>
+template<class BaseClock, class ClockTraits>
 void
-UnitTestClock<BaseClock>::setNow(const nanoseconds& timeSinceEpoch)
+UnitTestClock<BaseClock, ClockTraits>::setNow(nanoseconds timeSinceEpoch)
 {
-  BOOST_ASSERT(boost::posix_time::microseconds(SLEEP_AFTER_TIME_CHANGE.count()) >
-               boost::asio::time_traits<steady_clock>::to_posix_duration(timeSinceEpoch -
-                                                                         m_currentTime));
+  BOOST_ASSERT(!BaseClock::is_steady || timeSinceEpoch >= m_currentTime);
+
   m_currentTime = timeSinceEpoch;
-  std::this_thread::sleep_for(SLEEP_AFTER_TIME_CHANGE);
+
+  // See comment in advance()
+  auto delta = timeSinceEpoch - m_currentTime;
+  std::this_thread::sleep_for(std::chrono::nanoseconds(duration_cast<nanoseconds>(
+                                boost::asio::wait_traits<steady_clock>::to_wait_duration(delta) +
+                                typename BaseClock::duration(1)).count()));
 }
 
 template
diff --git a/src/util/time-unit-test-clock.hpp b/src/util/time-unit-test-clock.hpp
index 7d67507..0c6b90f 100644
--- a/src/util/time-unit-test-clock.hpp
+++ b/src/util/time-unit-test-clock.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_TIME_UNIT_TEST_CLOCK_HPP
-#define NDN_TIME_UNIT_TEST_CLOCK_HPP
+#ifndef NDN_UTIL_TIME_UNIT_TEST_CLOCK_HPP
+#define NDN_UTIL_TIME_UNIT_TEST_CLOCK_HPP
 
 #include "time-custom-clock.hpp"
 
@@ -48,7 +48,7 @@
  * @brief Specialization of UnitTestClockTraits for system_clock
  *
  * This specialization sets the default start time to 1415684132 seconds
- * (equivalent to Tue, 11 Nov 2014 05:35:32 UTC if unix epoch is assumed).
+ * (equivalent to Tue 11 Nov 2014 05:35:32 UTC, if Unix epoch is assumed).
  */
 template<>
 class UnitTestClockTraits<system_clock>
@@ -69,34 +69,34 @@
  *
  * @note Default start time is determined by UnitTestClockTraits
  */
-template<class BaseClock>
+template<class BaseClock, class ClockTraits = UnitTestClockTraits<BaseClock>>
 class UnitTestClock : public CustomClock<BaseClock>
 {
 public:
   explicit
-  UnitTestClock(const nanoseconds& startTime = UnitTestClockTraits<BaseClock>::getDefaultStartTime());
+  UnitTestClock(nanoseconds startTime = ClockTraits::getDefaultStartTime());
 
   /**
    * @brief Advance unit test clock by @p duration
    */
   void
-  advance(const nanoseconds& duration);
+  advance(nanoseconds duration);
 
   /**
    * @brief Explicitly set clock to @p timeSinceEpoch
    */
   void
-  setNow(const nanoseconds& timeSinceEpoch);
+  setNow(nanoseconds timeSinceEpoch);
 
-public: // CustomClock<BaseClock>
+public:
   std::string
   getSince() const override;
 
   typename BaseClock::time_point
   getNow() const override;
 
-  boost::posix_time::time_duration
-  toPosixDuration(const typename BaseClock::duration& duration) const override;
+  typename BaseClock::duration
+  toWaitDuration(typename BaseClock::duration d) const override;
 
 private:
   nanoseconds m_currentTime;
@@ -105,10 +105,10 @@
 extern template class UnitTestClock<system_clock>;
 extern template class UnitTestClock<steady_clock>;
 
-typedef UnitTestClock<system_clock> UnitTestSystemClock;
-typedef UnitTestClock<steady_clock> UnitTestSteadyClock;
+using UnitTestSystemClock = UnitTestClock<system_clock>;
+using UnitTestSteadyClock = UnitTestClock<steady_clock>;
 
 } // namespace time
 } // namespace ndn
 
-#endif // NDN_TIME_UNIT_TEST_CLOCK_HPP
+#endif // NDN_UTIL_TIME_UNIT_TEST_CLOCK_HPP
diff --git a/src/util/time.cpp b/src/util/time.cpp
index 6f669cb..e9af51f 100644
--- a/src/util/time.cpp
+++ b/src/util/time.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -31,13 +31,13 @@
 static shared_ptr<CustomSystemClock> g_systemClock;
 static shared_ptr<CustomSteadyClock> g_steadyClock;
 
-// this method is defined in time-custom-clock.hpp
+// this function is declared in time-custom-clock.hpp
 void
 setCustomClocks(shared_ptr<CustomSteadyClock> steadyClock,
                 shared_ptr<CustomSystemClock> systemClock)
 {
-  g_systemClock = systemClock;
-  g_steadyClock = steadyClock;
+  g_systemClock = std::move(systemClock);
+  g_steadyClock = std::move(steadyClock);
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////
@@ -55,7 +55,7 @@
 }
 
 std::time_t
-system_clock::to_time_t(const time_point& t) noexcept
+system_clock::to_time_t(const system_clock::time_point& t) noexcept
 {
   return duration_cast<seconds>(t.time_since_epoch()).count();
 }
@@ -88,21 +88,15 @@
   }
 }
 
-boost::posix_time::time_duration
-steady_clock::to_posix_duration(const duration& duration)
+steady_clock::duration
+steady_clock::to_wait_duration(steady_clock::duration d)
 {
   if (g_steadyClock == nullptr) {
     // optimized default version
-    return
-#ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
-      boost::posix_time::nanoseconds(duration_cast<nanoseconds>(duration).count())
-#else
-      boost::posix_time::microseconds(duration_cast<microseconds>(duration).count())
-#endif
-      ;
+    return d;
   }
   else {
-    return g_steadyClock->toPosixDuration(duration);
+    return g_steadyClock->toWaitDuration(d);
   }
 }
 
@@ -111,7 +105,7 @@
 const system_clock::TimePoint&
 getUnixEpoch()
 {
-  static system_clock::TimePoint epoch = system_clock::from_time_t(0);
+  static auto epoch = system_clock::from_time_t(0);
   return epoch;
 }
 
@@ -122,7 +116,7 @@
 }
 
 system_clock::TimePoint
-fromUnixTimestamp(const milliseconds& duration)
+fromUnixTimestamp(milliseconds duration)
 {
   return getUnixEpoch() + duration;
 }
@@ -141,28 +135,24 @@
   constexpr auto unitsPerHour = duration_cast<BptResolutionUnit>(hours(1)).count();
 
   auto sinceEpoch = duration_cast<BptResolutionUnit>(timePoint - getUnixEpoch()).count();
-  bpt::ptime ptime = epoch + bpt::time_duration(sinceEpoch / unitsPerHour, 0, 0,
-                                                sinceEpoch % unitsPerHour);
+  bpt::ptime ptime = epoch + bpt::time_duration(sinceEpoch / unitsPerHour, 0, 0, sinceEpoch % unitsPerHour);
 
   return bpt::to_iso_string(ptime);
 }
 
-
 system_clock::TimePoint
 fromIsoString(const std::string& isoString)
 {
   namespace bpt = boost::posix_time;
-  static bpt::ptime posixTimeEpoch = bpt::from_time_t(0);
+  static bpt::ptime epoch = bpt::from_time_t(0);
 
   bpt::ptime ptime = bpt::from_iso_string(isoString);
+  auto point = system_clock::from_time_t((ptime - epoch).total_seconds());
+  point += microseconds((ptime - epoch).total_microseconds() % 1000000);
 
-  system_clock::TimePoint point =
-    system_clock::from_time_t((ptime - posixTimeEpoch).total_seconds());
-  point += microseconds((ptime - posixTimeEpoch).total_microseconds() % 1000000);
   return point;
 }
 
-
 std::string
 toString(const system_clock::TimePoint& timePoint,
          const std::string& format/* = "%Y-%m-%d %H:%M:%S"*/,
@@ -182,25 +172,23 @@
   return formattedTimePoint.str();
 }
 
-
 system_clock::TimePoint
-fromString(const std::string& formattedTimePoint,
+fromString(const std::string& timePointStr,
            const std::string& format/* = "%Y-%m-%d %H:%M:%S"*/,
            const std::locale& locale/* = std::locale("C")*/)
 {
   namespace bpt = boost::posix_time;
-  static bpt::ptime posixTimeEpoch = bpt::from_time_t(0);
+  static bpt::ptime epoch = bpt::from_time_t(0);
 
   bpt::time_input_facet* facet = new bpt::time_input_facet(format);
-  std::istringstream is(formattedTimePoint);
-
+  std::istringstream is(timePointStr);
   is.imbue(std::locale(locale, facet));
   bpt::ptime ptime;
   is >> ptime;
 
-  system_clock::TimePoint point =
-    system_clock::from_time_t((ptime - posixTimeEpoch).total_seconds());
-  point += microseconds((ptime - posixTimeEpoch).total_microseconds() % 1000000);
+  auto point = system_clock::from_time_t((ptime - epoch).total_seconds());
+  point += microseconds((ptime - epoch).total_microseconds() % 1000000);
+
   return point;
 }
 
@@ -210,8 +198,6 @@
 namespace boost {
 namespace chrono {
 
-/////////////////////////////////////////////////////////////////////////////////////////////
-
 template<class CharT>
 std::basic_string<CharT>
 clock_string<ndn::time::system_clock, CharT>::since()
@@ -225,11 +211,6 @@
   }
 }
 
-template
-struct clock_string<ndn::time::system_clock, char>;
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-
 template<class CharT>
 std::basic_string<CharT>
 clock_string<ndn::time::steady_clock, CharT>::since()
@@ -243,8 +224,8 @@
   }
 }
 
-template
-struct clock_string<ndn::time::steady_clock, char>;
+template struct clock_string<ndn::time::system_clock, char>;
+template struct clock_string<ndn::time::steady_clock, char>;
 
 } // namespace chrono
 } // namespace boost
diff --git a/src/util/time.hpp b/src/util/time.hpp
index e239ccd..29274a5 100644
--- a/src/util/time.hpp
+++ b/src/util/time.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -19,30 +19,28 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#ifndef NDN_TIME_HPP
-#define NDN_TIME_HPP
+#ifndef NDN_UTIL_TIME_HPP
+#define NDN_UTIL_TIME_HPP
 
 #include "../common.hpp"
+
+#include <boost/asio/wait_traits.hpp>
 #include <boost/chrono.hpp>
-#include <boost/asio/time_traits.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
 
 namespace ndn {
 namespace time {
 
 using boost::chrono::duration;
+using boost::chrono::duration_cast;
 
-typedef duration<boost::int_least32_t, boost::ratio<86400> > days;
+using days = duration<int_fast32_t, boost::ratio<86400>>;
 using boost::chrono::hours;
 using boost::chrono::minutes;
 using boost::chrono::seconds;
-
 using boost::chrono::milliseconds;
 using boost::chrono::microseconds;
 using boost::chrono::nanoseconds;
 
-using boost::chrono::duration_cast;
-
 /** \return the absolute value of the duration d
  *  \note The function does not participate in the overload resolution
  *        unless std::numeric_limits<Rep>::is_signed is true.
@@ -64,13 +62,13 @@
  * adjusted at any moment. It is the only clock that has the ability
  * to be displayed and converted to/from UNIX timestamp.
  *
- * To get current TimePoint:
+ * To get the current time:
  *
  * <code>
  *     system_clock::TimePoint now = system_clock::now();
  * </code>
  *
- * To convert TimePoint to/from UNIX timestamp:
+ * To convert a TimePoint to/from UNIX timestamp:
  *
  * <code>
  *     system_clock::TimePoint time = ...;
@@ -81,11 +79,11 @@
 class system_clock
 {
 public:
-  typedef BOOST_SYSTEM_CLOCK_DURATION      duration;
-  typedef duration::rep                    rep;
-  typedef duration::period                 period;
-  typedef boost::chrono::time_point<system_clock> time_point;
-  static constexpr bool is_steady = false;
+  using duration   = boost::chrono::system_clock::duration;
+  using rep        = duration::rep;
+  using period     = duration::period;
+  using time_point = boost::chrono::time_point<system_clock>;
+  static constexpr bool is_steady = boost::chrono::system_clock::is_steady;
 
   typedef time_point TimePoint;
   typedef duration Duration;
@@ -98,7 +96,7 @@
 
   static time_point
   from_time_t(std::time_t t) noexcept;
-}; // class system_clock
+};
 
 /**
  * \brief Steady clock
@@ -111,10 +109,10 @@
 class steady_clock
 {
 public:
-  typedef nanoseconds      duration;
-  typedef duration::rep    rep;
-  typedef duration::period period;
-  typedef boost::chrono::time_point<steady_clock> time_point;
+  using duration   = boost::chrono::steady_clock::duration;
+  using rep        = duration::rep;
+  using period     = duration::period;
+  using time_point = boost::chrono::time_point<steady_clock>;
   static constexpr bool is_steady = true;
 
   typedef time_point TimePoint;
@@ -125,19 +123,18 @@
 
 private:
   /**
-   * \brief Method to be used in deadline timer to select proper waiting
+   * \brief Trait function used in detail::SteadyTimer to select proper waiting time
    *
-   * Mock time implementations should return minimum value to ensure Boost.Asio
-   * is not enabling any waiting on mock timers.
+   * Mock time implementations should return the minimum value to ensure
+   * that Boost.Asio doesn't perform any waiting on mock timers.
    *
-   * @sa http://stackoverflow.com/questions/14191855/how-do-you-mock-the-time-for-boost-timers
+   * @sa http://blog.think-async.com/2007/08/time-travel.html
    */
-  static boost::posix_time::time_duration
-  to_posix_duration(const duration& duration);
+  static duration
+  to_wait_duration(duration d);
 
-  friend struct boost::asio::time_traits<steady_clock>;
-}; // class steady_clock
-
+  friend struct boost::asio::wait_traits<steady_clock>; // see steady-timer.hpp
+};
 
 /**
  * \brief Get system_clock::TimePoint representing UNIX time epoch (00:00:00 on Jan 1, 1970)
@@ -155,13 +152,13 @@
  * \brief Convert UNIX timestamp to system_clock::TimePoint
  */
 system_clock::TimePoint
-fromUnixTimestamp(const milliseconds& duration);
+fromUnixTimestamp(milliseconds duration);
 
 /**
  * \brief Convert to the ISO string representation of the time (YYYYMMDDTHHMMSS,fffffffff)
  *
- * If timePoint contains doesn't contain fractional seconds the
- * output format is YYYYMMDDTHHMMSS
+ * If \p timePoint contains doesn't contain fractional seconds,
+ * the output format is YYYYMMDDTHHMMSS
  *
  * Examples:
  *
@@ -199,7 +196,7 @@
  * \param locale desired locale (default: "C" locale)
  *
  * \sa http://www.boost.org/doc/libs/1_54_0/doc/html/date_time/date_time_io.html#date_time.format_flags
- *     described possible formatting flags
+ *     describes possible formatting flags
  **/
 std::string
 toString(const system_clock::TimePoint& timePoint,
@@ -212,21 +209,18 @@
  * By default, `%Y-%m-%d %H:%M:%S` is used, accepting dates like
  * `2014-04-10 22:51:00`
  *
- * \param formattedTimePoint string representing time point
- * \param format    input output format (default: `%Y-%m-%d %H:%M:%S`)
- * \param locale    input locale (default: "C" locale)
+ * \param timePointStr string representing time point
+ * \param format input output format (default: `%Y-%m-%d %H:%M:%S`)
+ * \param locale input locale (default: "C" locale)
  *
  * \sa http://www.boost.org/doc/libs/1_54_0/doc/html/date_time/date_time_io.html#date_time.format_flags
- *     described possible formatting flags
+ *     describes possible formatting flags
  */
 system_clock::TimePoint
-fromString(const std::string& formattedTimePoint,
+fromString(const std::string& timePointStr,
            const std::string& format = "%Y-%m-%d %H:%M:%S",
            const std::locale& locale = std::locale("C"));
 
-
-////////////////////////////////////////////////////////////////////////////////
-
 } // namespace time
 } // namespace ndn
 
@@ -247,7 +241,10 @@
   since();
 };
 
+extern template struct clock_string<ndn::time::system_clock, char>;
+extern template struct clock_string<ndn::time::steady_clock, char>;
+
 } // namespace chrono
 } // namespace boost
 
-#endif // NDN_TIME_HPP
+#endif // NDN_UTIL_TIME_HPP
