diff --git a/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp b/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp
index b837339..f9bc22c 100644
--- a/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp
+++ b/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.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).
  *
@@ -126,7 +126,7 @@
 
   shared_ptr<Data> certBundle = make_shared<Data>();
   certBundle->setName(bundleName);
-  certBundle->setFreshnessPeriod(time::seconds(100));
+  certBundle->setFreshnessPeriod(100_s);
   certBundle->setContent(certList);
   certBundle->setFinalBlockId(name::Component::fromSegment(1));
 
@@ -139,7 +139,7 @@
 void
 CertificateBundleFetcherFixture<Timeout>::makeResponse(const Interest& interest)
 {
-  this->advanceClocks(time::seconds(200));
+  this->advanceClocks(200_s);
 }
 
 template<>
diff --git a/tests/unit-tests/security/v2/certificate-cache.t.cpp b/tests/unit-tests/security/v2/certificate-cache.t.cpp
index 56c7dd0..4ae3505 100644
--- a/tests/unit-tests/security/v2/certificate-cache.t.cpp
+++ b/tests/unit-tests/security/v2/certificate-cache.t.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).
  *
@@ -36,7 +36,7 @@
 {
 public:
   CertificateCacheFixture()
-    : certCache(time::seconds(10))
+    : certCache(10_s)
   {
     identity = addIdentity("/TestCertificateCache/");
     cert = identity.getDefaultKey().getDefaultCertificate();
@@ -57,16 +57,16 @@
   BOOST_CHECK_NO_THROW(certCache.insert(cert));
   BOOST_CHECK(certCache.find(cert.getName()) != nullptr);
 
-  advanceClocks(time::seconds(11), 1);
+  advanceClocks(11_s, 1);
   BOOST_CHECK(certCache.find(cert.getName()) == nullptr);
 
   BOOST_CHECK_NO_THROW(certCache.insert(cert));
   BOOST_CHECK(certCache.find(cert.getName()) != nullptr);
 
-  advanceClocks(time::seconds(5));
+  advanceClocks(5_s);
   BOOST_CHECK(certCache.find(cert.getName()) != nullptr);
 
-  advanceClocks(time::seconds(15));
+  advanceClocks(15_s);
   BOOST_CHECK(certCache.find(cert.getName()) == nullptr);
 }
 
@@ -79,7 +79,7 @@
   BOOST_CHECK(certCache.find(Interest(cert.getKeyName())) != nullptr);
   BOOST_CHECK(certCache.find(Interest(Name(cert.getName()).appendVersion())) == nullptr);
 
-  advanceClocks(time::seconds(12));
+  advanceClocks(12_s);
   BOOST_CHECK(certCache.find(Interest(cert.getIdentity())) == nullptr);
 
   Certificate cert3 = addCertificate(identity.getDefaultKey(), "3");
diff --git a/tests/unit-tests/security/v2/certificate-fetcher-from-network.t.cpp b/tests/unit-tests/security/v2/certificate-fetcher-from-network.t.cpp
index 0caa12f..e4b1ec9 100644
--- a/tests/unit-tests/security/v2/certificate-fetcher-from-network.t.cpp
+++ b/tests/unit-tests/security/v2/certificate-fetcher-from-network.t.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).
  *
@@ -110,7 +110,7 @@
   BOOST_CHECK_EQUAL(this->face.sentInterests.size(), 2);
   this->face.sentInterests.clear();
 
-  this->advanceClocks(time::hours(1), 2); // expire validator caches
+  this->advanceClocks(1_h, 2); // expire validator caches
 
   VALIDATE_SUCCESS(this->interest, "Should get accepted, as interests bring certs");
   BOOST_CHECK_EQUAL(this->face.sentInterests.size(), 2);
@@ -122,7 +122,7 @@
   BOOST_CHECK_GT(this->face.sentInterests.size(), 2);
   this->face.sentInterests.clear();
 
-  this->advanceClocks(time::hours(1), 2); // expire validator caches
+  this->advanceClocks(1_h, 2); // expire validator caches
 
   VALIDATE_FAILURE(this->interest, "Should fail, as interests don't bring data");
   BOOST_CHECK_GT(this->face.sentInterests.size(), 2);
diff --git a/tests/unit-tests/security/v2/certificate.t.cpp b/tests/unit-tests/security/v2/certificate.t.cpp
index 9522b55..5e0e24f 100644
--- a/tests/unit-tests/security/v2/certificate.t.cpp
+++ b/tests/unit-tests/security/v2/certificate.t.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).
  *
@@ -171,7 +171,7 @@
 {
   Certificate certificate;
   certificate.setName("/ndn/site1/KEY/ksk-1416425377094/0123/%FD%00%00%01I%C9%8B");
-  certificate.setFreshnessPeriod(time::seconds(3600));
+  certificate.setFreshnessPeriod(1_h);
   certificate.setContent(PUBLIC_KEY, sizeof(PUBLIC_KEY));
   certificate.setSignature(generateFakeSignature());
 
@@ -191,7 +191,7 @@
 {
   Certificate certificate;
   certificate.setName("/ndn/site1/KEY/ksk-1416425377094/0123/%FD%00%00%01I%C9%8B");
-  certificate.setFreshnessPeriod(time::seconds(3600));
+  certificate.setFreshnessPeriod(1_h);
   certificate.setContent(PUBLIC_KEY, sizeof(PUBLIC_KEY));
   certificate.setSignature(generateFakeSignature());
 
diff --git a/tests/unit-tests/security/v2/key-chain.t.cpp b/tests/unit-tests/security/v2/key-chain.t.cpp
index 9575754..d03f572 100644
--- a/tests/unit-tests/security/v2/key-chain.t.cpp
+++ b/tests/unit-tests/security/v2/key-chain.t.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).
  *
@@ -396,9 +396,8 @@
                        .getDefaultKey()
                        .getDefaultCertificate();
   BOOST_CHECK(cert.isValid());
-  BOOST_CHECK(cert.isValid(time::system_clock::now() + time::days(10 * 365)));
-  BOOST_CHECK_GT(cert.getValidityPeriod().getPeriod().second,
-                 time::system_clock::now() + time::days(10 * 365));
+  BOOST_CHECK(cert.isValid(time::system_clock::now() + 10 * 365_days));
+  BOOST_CHECK_GT(cert.getValidityPeriod().getPeriod().second, time::system_clock::now() + 10 * 365_days);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestKeyChain
diff --git a/tests/unit-tests/security/v2/trust-anchor-container.t.cpp b/tests/unit-tests/security/v2/trust-anchor-container.t.cpp
index 0efecdc..30749ac 100644
--- a/tests/unit-tests/security/v2/trust-anchor-container.t.cpp
+++ b/tests/unit-tests/security/v2/trust-anchor-container.t.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,10 +20,11 @@
  */
 
 #include "security/v2/trust-anchor-container.hpp"
+#include "util/io.hpp"
 
 #include "../../identity-management-time-fixture.hpp"
-#include "util/io.hpp"
 #include "boost-test.hpp"
+
 #include <boost/filesystem.hpp>
 
 namespace ndn {
@@ -97,21 +98,21 @@
   BOOST_CHECK_NO_THROW(anchorContainer.insert("group1", Certificate(cert1)));
   BOOST_CHECK_EQUAL(cert, anchorContainer.find(cert1.getName())); // still the same instance of the certificate
   // cannot add dynamic group when static already exists
-  BOOST_CHECK_THROW(anchorContainer.insert("group1", certPath1.string(), time::seconds(1)), TrustAnchorContainer::Error);
+  BOOST_CHECK_THROW(anchorContainer.insert("group1", certPath1.string(), 1_s), TrustAnchorContainer::Error);
   BOOST_CHECK_EQUAL(anchorContainer.getGroup("group1").size(), 1);
   BOOST_CHECK_EQUAL(anchorContainer.size(), 1);
 
   // From file
-  anchorContainer.insert("group2", certPath2.string(), time::seconds(1));
+  anchorContainer.insert("group2", certPath2.string(), 1_s);
   BOOST_CHECK(anchorContainer.find(cert2.getName()) != nullptr);
   BOOST_CHECK(anchorContainer.find(identity2.getName()) != nullptr);
   BOOST_CHECK_THROW(anchorContainer.insert("group2", Certificate(cert2)), TrustAnchorContainer::Error);
-  BOOST_CHECK_THROW(anchorContainer.insert("group2", certPath2.string(), time::seconds(1)), TrustAnchorContainer::Error);
+  BOOST_CHECK_THROW(anchorContainer.insert("group2", certPath2.string(), 1_s), TrustAnchorContainer::Error);
   BOOST_CHECK_EQUAL(anchorContainer.getGroup("group2").size(), 1);
   BOOST_CHECK_EQUAL(anchorContainer.size(), 2);
 
   boost::filesystem::remove(certPath2);
-  advanceClocks(time::seconds(1), 11);
+  advanceClocks(1_s, 11);
 
   BOOST_CHECK(anchorContainer.find(identity2.getName()) == nullptr);
   BOOST_CHECK(anchorContainer.find(cert2.getName()) == nullptr);
@@ -133,7 +134,7 @@
 {
   boost::filesystem::remove(certPath2);
 
-  anchorContainer.insert("group", certDirPath.string(), time::seconds(1), true /* isDir */);
+  anchorContainer.insert("group", certDirPath.string(), 1_s, true /* isDir */);
 
   BOOST_CHECK(anchorContainer.find(identity1.getName()) != nullptr);
   BOOST_CHECK(anchorContainer.find(identity2.getName()) == nullptr);
@@ -141,7 +142,7 @@
 
   saveCertToFile(cert2, certPath2.string());
 
-  advanceClocks(time::milliseconds(100), 11);
+  advanceClocks(100_ms, 11);
 
   BOOST_CHECK(anchorContainer.find(identity1.getName()) != nullptr);
   BOOST_CHECK(anchorContainer.find(identity2.getName()) != nullptr);
@@ -149,7 +150,7 @@
 
   boost::filesystem::remove_all(certDirPath);
 
-  advanceClocks(time::milliseconds(100), 11);
+  advanceClocks(100_ms, 11);
 
   BOOST_CHECK(anchorContainer.find(identity1.getName()) == nullptr);
   BOOST_CHECK(anchorContainer.find(identity2.getName()) == nullptr);
@@ -158,7 +159,7 @@
 
 BOOST_FIXTURE_TEST_CASE(FindByInterest, AnchorContainerTestFixture)
 {
-  anchorContainer.insert("group1", certPath1.string(), time::seconds(1));
+  anchorContainer.insert("group1", certPath1.string(), 1_s);
   Interest interest(identity1.getName());
   BOOST_CHECK(anchorContainer.find(interest) != nullptr);
   Interest interest1(identity1.getName().getPrefix(-1));
diff --git a/tests/unit-tests/security/v2/validation-policy-command-interest.t.cpp b/tests/unit-tests/security/v2/validation-policy-command-interest.t.cpp
index dd400b4..4a3365c 100644
--- a/tests/unit-tests/security/v2/validation-policy-command-interest.t.cpp
+++ b/tests/unit-tests/security/v2/validation-policy-command-interest.t.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).
  *
@@ -91,7 +91,7 @@
   auto i1 = makeCommandInterest(identity);
   VALIDATE_SUCCESS(i1, "Should succeed (within grace period)");
 
-  advanceClocks(time::milliseconds(5));
+  advanceClocks(5_ms);
   auto i2 = makeCommandInterest(identity);
   VALIDATE_SUCCESS(i2, "Should succeed (timestamp larger than previous)");
 }
@@ -173,7 +173,7 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(15);
+    options.gracePeriod = 15_s;
     return options;
   }
 };
@@ -181,7 +181,7 @@
 BOOST_FIXTURE_TEST_CASE(TimestampOutOfGracePositive, ValidationPolicyCommandInterestFixture<GracePeriod15Sec>)
 {
   auto i1 = makeCommandInterest(identity); // signed at 0s
-  advanceClocks(time::seconds(16)); // verifying at +16s
+  advanceClocks(16_s); // verifying at +16s
   VALIDATE_FAILURE(i1, "Should fail (timestamp outside the grace period)");
   rewindClockAfterValidation();
 
@@ -192,12 +192,12 @@
 BOOST_FIXTURE_TEST_CASE(TimestampOutOfGraceNegative, ValidationPolicyCommandInterestFixture<GracePeriod15Sec>)
 {
   auto i1 = makeCommandInterest(identity); // signed at 0s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i2 = makeCommandInterest(identity); // signed at +1s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i3 = makeCommandInterest(identity); // signed at +2s
 
-  systemClock->advance(time::seconds(-18)); // verifying at -16s
+  systemClock->advance(-18_s); // verifying at -16s
   VALIDATE_FAILURE(i1, "Should fail (timestamp outside the grace period)");
   rewindClockAfterValidation();
 
@@ -206,7 +206,7 @@
   rewindClockAfterValidation();
 
   // CommandInterestValidator should not remember i2's timestamp, and should treat i3 as initial
-  advanceClocks(time::seconds(18)); // verifying at +2s
+  advanceClocks(18_s); // verifying at +2s
   VALIDATE_SUCCESS(i3, "Should succeed");
 }
 
@@ -220,7 +220,7 @@
                    i1.getName()[command_interest::POS_TIMESTAMP]);
   VALIDATE_FAILURE(i2, "Should fail (timestamp reordered)");
 
-  advanceClocks(time::seconds(2));
+  advanceClocks(2_s);
   auto i3 = makeCommandInterest(identity); // signed at +2s
   VALIDATE_SUCCESS(i3, "Should succeed");
 }
@@ -228,27 +228,27 @@
 BOOST_AUTO_TEST_CASE(TimestampReorderNegative)
 {
   auto i2 = makeCommandInterest(identity); // signed at 0ms
-  advanceClocks(time::milliseconds(200));
+  advanceClocks(200_ms);
   auto i3 = makeCommandInterest(identity); // signed at +200ms
-  advanceClocks(time::milliseconds(900));
+  advanceClocks(900_ms);
   auto i1 = makeCommandInterest(identity); // signed at +1100ms
-  advanceClocks(time::milliseconds(300));
+  advanceClocks(300_ms);
   auto i4 = makeCommandInterest(identity); // signed at +1400ms
 
-  systemClock->advance(time::milliseconds(-300)); // verifying at +1100ms
+  systemClock->advance(-300_ms); // verifying at +1100ms
   VALIDATE_SUCCESS(i1, "Should succeed");
   rewindClockAfterValidation();
 
-  systemClock->advance(time::milliseconds(-1100)); // verifying at 0ms
+  systemClock->advance(-1100_ms); // verifying at 0ms
   VALIDATE_FAILURE(i2, "Should fail (timestamp reordered)");
   rewindClockAfterValidation();
 
   // CommandInterestValidator should not remember i2's timestamp
-  advanceClocks(time::milliseconds(200)); // verifying at +200ms
+  advanceClocks(200_ms); // verifying at +200ms
   VALIDATE_FAILURE(i3, "Should fail (timestamp reordered)");
   rewindClockAfterValidation();
 
-  advanceClocks(time::milliseconds(1200)); // verifying at 1400ms
+  advanceClocks(1200_ms); // verifying at 1400ms
   VALIDATE_SUCCESS(i4, "Should succeed");
 }
 
@@ -287,7 +287,7 @@
   VALIDATE_SUCCESS(i1, "Should succeed when validating at 0ms");
   this->rewindClockAfterValidation();
 
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
   VALIDATE_FAILURE(i2, "Should fail when validating at 1ms");
 }
 
@@ -298,7 +298,7 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(15);
+    options.gracePeriod = 15_s;
     options.maxRecords = 3;
     return options;
   }
@@ -319,9 +319,9 @@
   auto i2 = makeCommandInterest(id3);
   auto i3 = makeCommandInterest(id4);
   auto i00 = makeCommandInterest(id1); // signed at 0s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i01 = makeCommandInterest(id1); // signed at 1s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i02 = makeCommandInterest(id1); // signed at 2s
 
   VALIDATE_SUCCESS(i00, "Should succeed");
@@ -349,7 +349,7 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(15);
+    options.gracePeriod = 15_s;
     options.maxRecords = -1;
     return options;
   }
@@ -365,7 +365,7 @@
   }
 
   auto i1 = makeCommandInterest(identities.at(0)); // signed at 0s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   for (int i = 0; i < 20; ++i) {
     auto i2 = makeCommandInterest(identities.at(i)); // signed at +1s
 
@@ -382,7 +382,7 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(15);
+    options.gracePeriod = 15_s;
     options.maxRecords = 0;
     return options;
   }
@@ -391,7 +391,7 @@
 BOOST_FIXTURE_TEST_CASE(ZeroRecords, ValidationPolicyCommandInterestFixture<ZeroRecordsOptions>)
 {
   auto i1 = makeCommandInterest(identity); // signed at 0s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i2 = makeCommandInterest(identity); // signed at +1s
   VALIDATE_SUCCESS(i2, "Should succeed");
   rewindClockAfterValidation();
@@ -406,8 +406,8 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(400);
-    options.recordLifetime = time::seconds(300);
+    options.gracePeriod = 400_s;
+    options.recordLifetime = 300_s;
     return options;
   }
 };
@@ -415,19 +415,19 @@
 BOOST_FIXTURE_TEST_CASE(LimitedRecordLifetime, ValidationPolicyCommandInterestFixture<LimitedRecordLifetimeOptions>)
 {
   auto i1 = makeCommandInterest(identity); // signed at 0s
-  advanceClocks(time::seconds(240));
+  advanceClocks(240_s);
   auto i2 = makeCommandInterest(identity); // signed at +240s
-  advanceClocks(time::seconds(120));
+  advanceClocks(120_s);
   auto i3 = makeCommandInterest(identity); // signed at +360s
 
-  systemClock->advance(time::seconds(-360)); // rewind system clock to 0s
+  systemClock->advance(-360_s); // rewind system clock to 0s
   VALIDATE_SUCCESS(i1, "Should succeed");
   rewindClockAfterValidation();
 
   VALIDATE_SUCCESS(i3, "Should succeed");
   rewindClockAfterValidation();
 
-  advanceClocks(time::seconds(30), time::seconds(301)); // advance steady clock by 301s, and system clock to +301s
+  advanceClocks(30_s, 301_s); // advance steady clock by 301s, and system clock to +301s
   VALIDATE_SUCCESS(i2, "Should succeed despite timestamp is reordered, because record has been expired");
 }
 
@@ -438,7 +438,7 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(15);
+    options.gracePeriod = 15_s;
     options.recordLifetime = time::seconds::zero();
     return options;
   }
@@ -447,7 +447,7 @@
 BOOST_FIXTURE_TEST_CASE(ZeroRecordLifetime, ValidationPolicyCommandInterestFixture<ZeroRecordLifetimeOptions>)
 {
   auto i1 = makeCommandInterest(identity); // signed at 0s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i2 = makeCommandInterest(identity); // signed at +1s
   VALIDATE_SUCCESS(i2, "Should succeed");
   rewindClockAfterValidation();
diff --git a/tests/unit-tests/security/v2/validation-policy-config.t.cpp b/tests/unit-tests/security/v2/validation-policy-config.t.cpp
index 7808700..31cba27 100644
--- a/tests/unit-tests/security/v2/validation-policy-config.t.cpp
+++ b/tests/unit-tests/security/v2/validation-policy-config.t.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).
  *
@@ -232,7 +232,7 @@
   static time::milliseconds
   getRefreshTime()
   {
-    return time::hours(1);
+    return 1_h;
   }
 };
 
@@ -248,7 +248,7 @@
   static time::milliseconds
   getRefreshTime()
   {
-    return time::minutes(1);
+    return 1_min;
   }
 };
 
@@ -264,7 +264,7 @@
   static time::milliseconds
   getRefreshTime()
   {
-    return time::seconds(1);
+    return 1_s;
   }
 };
 
diff --git a/tests/unit-tests/security/v2/validator-fixture.hpp b/tests/unit-tests/security/v2/validator-fixture.hpp
index 7f52048..c9a5763 100644
--- a/tests/unit-tests/security/v2/validator-fixture.hpp
+++ b/tests/unit-tests/security/v2/validator-fixture.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).
  *
@@ -43,7 +43,7 @@
     : face(io, {true, true})
     , validator(make_unique<ValidationPolicy>(), make_unique<CertificateFetcher>(face))
     , policy(static_cast<ValidationPolicy&>(validator.getPolicy()))
-    , cache(time::days(100))
+    , cache(100_days)
   {
     processInterest = [this] (const Interest& interest) {
       auto cert = cache.find(interest);
diff --git a/tests/unit-tests/security/v2/validator.t.cpp b/tests/unit-tests/security/v2/validator.t.cpp
index ac5ca86..af64557 100644
--- a/tests/unit-tests/security/v2/validator.t.cpp
+++ b/tests/unit-tests/security/v2/validator.t.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).
  *
@@ -104,8 +104,8 @@
 {
   Data expiredCert = subIdentity.getDefaultKey().getDefaultCertificate();
   SignatureInfo info;
-  info.setValidityPeriod(ValidityPeriod(time::system_clock::now() - time::hours(2),
-                                        time::system_clock::now() - time::hours(1)));
+  info.setValidityPeriod(ValidityPeriod(time::system_clock::now() - 2_h,
+                                        time::system_clock::now() - 1_h));
   m_keyChain.sign(expiredCert, signingByIdentity(identity).setSignatureInfo(info));
   BOOST_REQUIRE_NO_THROW(Certificate(expiredCert.wireEncode()));
 
@@ -150,7 +150,7 @@
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
   face.sentInterests.clear();
 
-  advanceClocks(time::hours(1), 2); // expire trusted cache
+  advanceClocks(1_h, 2); // expire trusted cache
 
   VALIDATE_FAILURE(data, "Should try and fail to retrieve certs");
   BOOST_CHECK_GT(face.sentInterests.size(), 1);
@@ -187,7 +187,7 @@
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
   face.sentInterests.clear();
 
-  advanceClocks(time::minutes(10), 2); // expire untrusted cache
+  advanceClocks(10_min, 2); // expire untrusted cache
 
   VALIDATE_FAILURE(data, "Should try and fail to retrieve certs");
   BOOST_CHECK_GT(face.sentInterests.size(), 1);
@@ -246,7 +246,7 @@
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
   face.sentInterests.clear();
 
-  advanceClocks(time::hours(1), 2); // expire trusted cache
+  advanceClocks(1_h, 2); // expire trusted cache
 
   m_keyChain.sign(interest, signingByIdentity(subSelfSignedIdentity));
   m_keyChain.sign(data, signingByIdentity(subSelfSignedIdentity));
@@ -272,15 +272,15 @@
 
     // set metainfo
     certificate.setContentType(tlv::ContentType_Key);
-    certificate.setFreshnessPeriod(time::hours(1));
+    certificate.setFreshnessPeriod(1_h);
 
     // set content
     certificate.setContent(requestedKey.getPublicKey().data(), requestedKey.getPublicKey().size());
 
     // set signature-info
     SignatureInfo info;
-    info.setValidityPeriod(security::ValidityPeriod(time::system_clock::now() - time::days(10),
-                                                    time::system_clock::now() + time::days(10)));
+    info.setValidityPeriod(security::ValidityPeriod(time::system_clock::now() - 10_days,
+                                                    time::system_clock::now() + 10_days));
 
     m_keyChain.sign(certificate, signingByKey(parentKey).setSignatureInfo(info));
     face.receive(certificate);
@@ -295,7 +295,7 @@
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 40);
   face.sentInterests.clear();
 
-  advanceClocks(time::hours(1), 5); // expire caches
+  advanceClocks(1_h, 5); // expire caches
 
   validator.setMaxDepth(30);
   BOOST_CHECK_EQUAL(validator.getMaxDepth(), 30);
@@ -315,8 +315,8 @@
     request.setName(Name(key.getName()).append("looper").appendVersion());
 
     SignatureInfo info;
-    info.setValidityPeriod({time::system_clock::now() - time::days(100),
-                            time::system_clock::now() + time::days(100)});
+    info.setValidityPeriod({time::system_clock::now() - 100_days,
+                            time::system_clock::now() + 100_days});
     m_keyChain.sign(request, signingByKey(signer).setSignatureInfo(info));
     m_keyChain.addCertificate(key, request);
 
