diff --git a/src/management/ndnd-controller.cpp b/src/management/ndnd-controller.cpp
index b3b7821..1d3fb60 100644
--- a/src/management/ndnd-controller.cpp
+++ b/src/management/ndnd-controller.cpp
@@ -139,7 +139,7 @@
 
   Interest interest(interestName);
   interest.setScope(1);
-  interest.setInterestLifetime(1000);
+  interest.setInterestLifetime(time::seconds(1));
   interest.setMustBeFresh(true);
 
   m_face.expressInterest(interest,
@@ -172,7 +172,7 @@
 
   Interest interest(interestName);
   interest.setScope(1);
-  interest.setInterestLifetime(1000);
+  interest.setInterestLifetime(time::seconds(1));
   interest.setMustBeFresh(true);
 
   m_face.expressInterest(interest,
diff --git a/src/management/ndnd-face-instance.hpp b/src/management/ndnd-face-instance.hpp
index 1da6b94..60c07dc 100644
--- a/src/management/ndnd-face-instance.hpp
+++ b/src/management/ndnd-face-instance.hpp
@@ -18,7 +18,7 @@
  * An FaceInstance holds an action and  Name prefix and other fields for an forwarding entry.
  */
 class FaceInstance {
-public:    
+public:
   FaceInstance(const std::string &action,
                int64_t     faceId,
                uint32_t    ipProto,
@@ -26,7 +26,7 @@
                const std::string &port,
                const std::string &multicastInterface,
                uint32_t    multicastTtl,
-               Milliseconds freshnessPeriod) 
+               const time::milliseconds& freshnessPeriod)
     : action_(action)
     , faceId_(faceId)
     , ipProto_(ipProto)
@@ -42,73 +42,79 @@
     : faceId_(-1)
     , ipProto_(-1)
     , multicastTtl_(-1)
-    , freshnessPeriod_(-1)
+    , freshnessPeriod_(time::milliseconds::min())
   {
   }
 
   // Action
-  const std::string& 
+  const std::string&
   getAction() const { return action_; }
 
-  void 
+  void
   setAction(const std::string& action) { action_ = action; wire_.reset(); }
 
   // FaceID
   int64_t
   getFaceId() const { return faceId_; }
 
-  void 
+  void
   setFaceId(int64_t faceId) { faceId_ = faceId; wire_.reset(); }
 
   // IPProto
-  int32_t 
+  int32_t
   getIpProto() const { return ipProto_; }
 
-  void 
+  void
   setIpProto(int32_t ipProto) { ipProto_ = ipProto; wire_.reset(); }
 
   // Host
-  const std::string& 
+  const std::string&
   getHost() const { return host_; }
 
-  void 
+  void
   setHost(const std::string& host) { host_ = host; wire_.reset(); }
 
   // Port
   const std::string&
   getPort() const { return port_; }
 
-  void 
+  void
   setPort(const std::string &port) { port_ = port; wire_.reset(); }
 
   // MulticastInterface
-  const std::string& 
+  const std::string&
   getMulticastInterface() const { return multicastInterface_; }
 
-  void 
-  setMulticastInterface(const std::string& multicastInterface) { multicastInterface_ = multicastInterface; wire_.reset(); }
+  void
+  setMulticastInterface(const std::string& multicastInterface)
+  {
+    multicastInterface_ = multicastInterface; wire_.reset();
+  }
 
   // MulticastTTL
   int32_t
   getMulticastTtl() const { return multicastTtl_; }
 
-  void 
+  void
   setMulticastTtl(int32_t multicastTtl) { multicastTtl_ = multicastTtl; wire_.reset(); }
 
   // Freshness
-  int 
+  const time::milliseconds&
   getFreshnessPeriod() const { return freshnessPeriod_; }
 
-  void 
-  setFreshnessPeriod(int freshnessPeriod) { freshnessPeriod_ = freshnessPeriod; wire_.reset(); }
+  void
+  setFreshnessPeriod(const time::milliseconds& freshnessPeriod)
+  {
+    freshnessPeriod_ = freshnessPeriod; wire_.reset();
+  }
 
   // Wire
   inline const Block&
   wireEncode() const;
-  
-  inline void 
+
+  inline void
   wireDecode(const Block &wire);
-  
+
 private:
   std::string action_;
   int64_t     faceId_;
@@ -117,8 +123,8 @@
   std::string port_;
   std::string multicastInterface_;
   int32_t     multicastTtl_;
-  Milliseconds freshnessPeriod_;
-  
+  time::milliseconds freshnessPeriod_;
+
   mutable Block wire_;
 };
 
@@ -137,7 +143,7 @@
   //                  MulticastInterface?
   //                  MulticastTTL?
   //                  FreshnessPeriod?
-  
+
   wire_ = Block(tlv::ndnd::FaceInstance);
 
   // Action
@@ -160,7 +166,7 @@
       wire_.push_back
         (nonNegativeIntegerBlock(tlv::ndnd::IPProto, ipProto_));
     }
-  
+
   // Host
   if (!host_.empty())
     {
@@ -190,17 +196,17 @@
     }
 
   // FreshnessPeriod
-  if (freshnessPeriod_ >= 0)
+  if (freshnessPeriod_ >= time::milliseconds::zero())
     {
       wire_.push_back
-        (nonNegativeIntegerBlock(Tlv::FreshnessPeriod, freshnessPeriod_));
+        (nonNegativeIntegerBlock(Tlv::FreshnessPeriod, freshnessPeriod_.count()));
     }
-  
+
   wire_.encode();
-  return wire_;    
+  return wire_;
 }
-  
-inline void 
+
+inline void
 FaceInstance::wireDecode(const Block &wire)
 {
   action_.clear();
@@ -210,7 +216,7 @@
   port_.clear();
   multicastInterface_.clear();
   multicastTtl_ = -1;
-  freshnessPeriod_ = -1;
+  freshnessPeriod_ = time::milliseconds::min();
 
   wire_ = wire;
   wire_.parse();
@@ -278,7 +284,7 @@
   val = wire_.find(Tlv::FreshnessPeriod);
   if (val != wire_.elements_end())
     {
-      freshnessPeriod_ = readNonNegativeInteger(*val);
+      freshnessPeriod_ = time::milliseconds(readNonNegativeInteger(*val));
     }
 }
 
@@ -286,7 +292,7 @@
 operator << (std::ostream &os, const FaceInstance &entry)
 {
   os << "FaceInstance(";
-  
+
   // Action
   if (!entry.getAction().empty())
     {
@@ -330,7 +336,7 @@
     }
 
   // FreshnessPeriod
-  if (entry.getFreshnessPeriod() >= 0)
+  if (entry.getFreshnessPeriod() >= time::milliseconds::zero())
     {
       os << "FreshnessPeriod:" << entry.getFreshnessPeriod() << ", ";
     }
@@ -343,4 +349,3 @@
 } // namespace ndn
 
 #endif // NDN_MANAGEMENT_NDND_FACE_INSTANCE_HPP
-
diff --git a/src/management/ndnd-forwarding-entry.hpp b/src/management/ndnd-forwarding-entry.hpp
index 3d262f1..03272b1 100644
--- a/src/management/ndnd-forwarding-entry.hpp
+++ b/src/management/ndnd-forwarding-entry.hpp
@@ -20,12 +20,12 @@
  * An ForwardingEntry holds an action and  Name prefix and other fields for an forwarding entry.
  */
 class ForwardingEntry {
-public:    
+public:
   ForwardingEntry(const std::string& action,
                   const Name& prefix,
                   int faceId = -1,
                   const ForwardingFlags& forwardingFlags = ForwardingFlags(),
-                  int freshnessPeriod = -1) 
+                  time::milliseconds freshnessPeriod = time::milliseconds::min())
     : action_(action)
     , prefix_(prefix)
     , faceId_(faceId)
@@ -36,52 +36,52 @@
 
   ForwardingEntry()
   : faceId_(-1)
-  , freshnessPeriod_(-1)
+  , freshnessPeriod_(time::milliseconds::min())
   {
   }
-  
-  const std::string& 
+
+  const std::string&
   getAction() const { return action_; }
 
-  void 
+  void
   setAction(const std::string& action) { action_ = action; wire_.reset(); }
-    
-  const Name& 
+
+  const Name&
   getPrefix() const { return prefix_; }
-  
+
   void
   setPrefix(const Name &prefix) { prefix_ = prefix; wire_.reset(); }
-  
-  int 
+
+  int
   getFaceId() const { return faceId_; }
 
-  void 
+  void
   setFaceId(int faceId) { faceId_ = faceId; wire_.reset(); }
-      
-  const ForwardingFlags& 
+
+  const ForwardingFlags&
   getForwardingFlags() const { return forwardingFlags_; }
 
-  void 
+  void
   setForwardingFlags(const ForwardingFlags& forwardingFlags) { forwardingFlags_ = forwardingFlags; wire_.reset(); }
-      
-  int 
+
+  const time::milliseconds&
   getFreshnessPeriod() const { return freshnessPeriod_; }
 
-  void 
-  setFreshnessPeriod(int freshnessPeriod) { freshnessPeriod_ = freshnessPeriod; wire_.reset(); }
+  void
+  setFreshnessPeriod(const time::milliseconds& freshnessPeriod) { freshnessPeriod_ = freshnessPeriod; wire_.reset(); }
 
   inline const Block&
   wireEncode() const;
-  
-  inline void 
+
+  inline void
   wireDecode(const Block &wire);
-  
+
 private:
   std::string action_;   /**< empty for none. */
   Name prefix_;
   int faceId_;           /**< -1 for none. */
   ForwardingFlags forwardingFlags_;
-  int freshnessPeriod_; /**< -1 for none. */
+  time::milliseconds freshnessPeriod_; /**< time::milliseconds::min() for none. */
 
   mutable Block wire_;
 };
@@ -98,7 +98,7 @@
   //                       FaceID?
   //                       ForwardingFlags?
   //                       FreshnessPeriod?
-  
+
   wire_ = Block(tlv::ndnd::ForwardingEntry);
 
   // Action
@@ -124,24 +124,24 @@
     (forwardingFlags_.wireEncode());
 
   // FreshnessPeriod
-  if (freshnessPeriod_ >= 0)
+  if (freshnessPeriod_ >= time::milliseconds::zero())
     {
       wire_.push_back
-        (nonNegativeIntegerBlock(Tlv::FreshnessPeriod, freshnessPeriod_));
+        (nonNegativeIntegerBlock(Tlv::FreshnessPeriod, freshnessPeriod_.count()));
     }
-  
+
   wire_.encode();
-  return wire_;    
+  return wire_;
 }
-  
-inline void 
+
+inline void
 ForwardingEntry::wireDecode(const Block &wire)
 {
   action_.clear();
   prefix_.clear();
   faceId_ = -1;
   forwardingFlags_ = ForwardingFlags();
-  freshnessPeriod_ = -1;
+  freshnessPeriod_ = time::milliseconds::min();
 
   wire_ = wire;
   wire_.parse();
@@ -185,7 +185,7 @@
   val = wire_.find(Tlv::FreshnessPeriod);
   if (val != wire_.elements_end())
     {
-      freshnessPeriod_ = readNonNegativeInteger(*val);
+      freshnessPeriod_ = time::milliseconds(readNonNegativeInteger(*val));
     }
 }
 
@@ -193,7 +193,7 @@
 operator << (std::ostream &os, const ForwardingEntry &entry)
 {
   os << "ForwardingEntry(";
-  
+
   // Action
   if (!entry.getAction().empty())
     {
@@ -213,7 +213,7 @@
   os << "ForwardingFlags:" << entry.getForwardingFlags() << ", ";
 
   // FreshnessPeriod
-  if (entry.getFreshnessPeriod() >= 0)
+  if (entry.getFreshnessPeriod() >= time::milliseconds::zero())
     {
       os << "FreshnessPeriod:" << entry.getFreshnessPeriod() << ", ";
     }
diff --git a/src/management/nfd-status.hpp b/src/management/nfd-status.hpp
index fa7f884..e00c705 100644
--- a/src/management/nfd-status.hpp
+++ b/src/management/nfd-status.hpp
@@ -44,8 +44,6 @@
   wireDecode(const Block& payload);
 
 public:
-  typedef boost::chrono::time_point<boost::chrono::system_clock, boost::chrono::seconds> Timestamp;
-
   int
   getNfdVersion() const
   {
@@ -58,26 +56,26 @@
     m_nfdVersion = nfdVersion;
   }
 
-  Timestamp
+  const time::system_clock::TimePoint&
   getStartTimestamp() const
   {
     return m_startTimestamp;
   }
 
   void
-  setStartTimestamp(Timestamp startTimestamp)
+  setStartTimestamp(const time::system_clock::TimePoint& startTimestamp)
   {
     m_startTimestamp = startTimestamp;
   }
 
-  Timestamp
+  const time::system_clock::TimePoint&
   getCurrentTimestamp() const
   {
     return m_currentTimestamp;
   }
 
   void
-  setCurrentTimestamp(Timestamp currentTimestamp)
+  setCurrentTimestamp(const time::system_clock::TimePoint& currentTimestamp)
   {
     m_currentTimestamp = currentTimestamp;
   }
@@ -192,8 +190,8 @@
 
 private:
   int       m_nfdVersion;
-  Timestamp m_startTimestamp;
-  Timestamp m_currentTimestamp;
+  time::system_clock::TimePoint m_startTimestamp;
+  time::system_clock::TimePoint m_currentTimestamp;
   size_t    m_nNameTreeEntries;
   size_t    m_nFibEntries;
   size_t    m_nPitEntries;
@@ -205,24 +203,22 @@
   int       m_nOutDatas;
 };
 
-BOOST_STATIC_ASSERT((boost::is_same<Status::Timestamp::period, boost::ratio<1> >::value));
-
 inline
 Status::Status()
-{
-  m_nfdVersion = 0;
-  m_startTimestamp = Timestamp::min();
-  m_currentTimestamp = Timestamp::min();
-  m_nNameTreeEntries = 0;
-  m_nFibEntries = 0;
-  m_nPitEntries = 0;
-  m_nMeasurementsEntries = 0;
-  m_nCsEntries = 0;
-  m_nInInterests = 0;
-  m_nOutInterests = 0;
-  m_nInDatas = 0;
-  m_nOutDatas = 0;
-}
+  : m_nfdVersion(0)
+  , m_startTimestamp(time::system_clock::TimePoint::min())
+  , m_currentTimestamp(time::system_clock::TimePoint::min())
+  , m_nNameTreeEntries(0)
+  , m_nFibEntries(0)
+  , m_nPitEntries(0)
+  , m_nMeasurementsEntries(0)
+  , m_nCsEntries(0)
+  , m_nInInterests(0)
+  , m_nOutInterests(0)
+  , m_nInDatas(0)
+  , m_nOutDatas(0)
+  {
+  }
 
 template<bool T>
 inline size_t
@@ -249,9 +245,9 @@
   total_len += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NNameTreeEntries,
                                               m_nNameTreeEntries);
   total_len += prependNonNegativeIntegerBlock(encoder, tlv::nfd::CurrentTimestamp,
-               m_currentTimestamp.time_since_epoch().count());
+                                              time::toUnixTimestamp(m_currentTimestamp).count());
   total_len += prependNonNegativeIntegerBlock(encoder, tlv::nfd::StartTimestamp,
-               m_startTimestamp.time_since_epoch().count());
+                                              time::toUnixTimestamp(m_startTimestamp).count());
   total_len += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NfdVersion,
                                               m_nfdVersion);
 
@@ -262,8 +258,8 @@
 Status::wireDecode(const Block& payload)
 {
   m_nfdVersion = 0;
-  m_startTimestamp = Timestamp::min();
-  m_currentTimestamp = Timestamp::min();
+  m_startTimestamp = time::system_clock::TimePoint::min();
+  m_currentTimestamp = time::system_clock::TimePoint::min();
   m_nNameTreeEntries = 0;
   m_nFibEntries = 0;
   m_nPitEntries = 0;
@@ -288,12 +284,12 @@
 
   val = payload.find(tlv::nfd::StartTimestamp);
   if (val != payload.elements_end()) {
-    m_startTimestamp = Timestamp(boost::chrono::seconds(readNonNegativeInteger(*val)));
+    m_startTimestamp = time::fromUnixTimestamp(time::milliseconds(readNonNegativeInteger(*val)));
   }
 
   val = payload.find(tlv::nfd::CurrentTimestamp);
   if (val != payload.elements_end()) {
-    m_currentTimestamp = Timestamp(boost::chrono::seconds(readNonNegativeInteger(*val)));
+    m_currentTimestamp = time::fromUnixTimestamp(time::milliseconds(readNonNegativeInteger(*val)));
   }
 
   val = payload.find(tlv::nfd::NNameTreeEntries);
diff --git a/src/management/nrd-prefix-reg-options.hpp b/src/management/nrd-prefix-reg-options.hpp
index 412194b..c80d04b 100644
--- a/src/management/nrd-prefix-reg-options.hpp
+++ b/src/management/nrd-prefix-reg-options.hpp
@@ -26,13 +26,13 @@
  */
 class PrefixRegOptions {
 public:
-  struct Error : public Tlv::Error { Error(const std::string &what) : Tlv::Error(what) {} };
+  struct Error : public Tlv::Error { Error(const std::string& what) : Tlv::Error(what) {} };
 
   PrefixRegOptions()
-    : m_faceId (INVALID_FACE_ID)
-    , m_flags (DEFAULT_FLAGS)
-    , m_cost (DEFAULT_COST)
-    , m_expirationPeriod (-1)
+    : m_faceId(INVALID_FACE_ID)
+    , m_flags(DEFAULT_FLAGS)
+    , m_cost(DEFAULT_COST)
+    , m_expirationPeriod(time::milliseconds::min())
   {
   }
 
@@ -117,14 +117,14 @@
 
   //
 
-  Milliseconds
+  const time::milliseconds&
   getExpirationPeriod() const
   {
     return m_expirationPeriod;
   }
 
   PrefixRegOptions&
-  setExpirationPeriod(Milliseconds expirationPeriod)
+  setExpirationPeriod(const time::milliseconds& expirationPeriod)
   {
     m_expirationPeriod = expirationPeriod;
     m_wire.reset();
@@ -152,7 +152,7 @@
   uint64_t m_faceId;
   uint64_t m_flags;
   uint64_t m_cost;
-  Milliseconds m_expirationPeriod;
+  time::milliseconds m_expirationPeriod;
   std::string m_protocol;
 
   mutable Block m_wire;
@@ -184,10 +184,11 @@
     }
 
   // ExpirationPeriod
-  if (m_expirationPeriod > 0)
+  if (m_expirationPeriod > time::milliseconds::zero())
     {
       total_len += prependNonNegativeIntegerBlock(block,
-                                                  tlv::nrd::ExpirationPeriod, m_expirationPeriod);
+                                                  tlv::nrd::ExpirationPeriod,
+                                                  m_expirationPeriod.count());
     }
 
   // Cost
@@ -247,7 +248,7 @@
   m_faceId = INVALID_FACE_ID;
   m_flags = DEFAULT_FLAGS;
   m_cost = DEFAULT_COST;
-  m_expirationPeriod = -1;
+  m_expirationPeriod = time::milliseconds::min();
   m_protocol.clear();
 
   m_wire = wire;
@@ -289,7 +290,7 @@
   val = m_wire.find(tlv::nrd::ExpirationPeriod);
   if (val != m_wire.elements_end())
     {
-      m_expirationPeriod = readNonNegativeInteger(*val);
+      m_expirationPeriod = time::milliseconds(readNonNegativeInteger(*val));
     }
 
   // Protocol
