diff --git a/src/common.cpp b/src/common.cpp
index 31569e3..53df6e1 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -7,13 +7,7 @@
 
 #include <sstream>
 #include <ndn-cpp-dev/common.hpp>
-
-#if NDN_CPP_HAVE_TIME_H
-#include <time.h>
-#endif
-#if NDN_CPP_HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
+#include "util/time.hpp"
 
 using namespace std;
 
@@ -40,10 +34,7 @@
 MillisecondsSince1970
 getNow()
 {
-  struct timeval t;
-  // Note: configure.ac requires gettimeofday.
-  gettimeofday(&t, 0);
-  return t.tv_sec * 1000.0 + t.tv_usec / 1000.0;
+  return getNowMilliseconds();
 }
 
 
diff --git a/src/encoding/cryptopp/asn_ext.cpp b/src/encoding/cryptopp/asn_ext.cpp
index 7a8eda1..4df06c5 100644
--- a/src/encoding/cryptopp/asn_ext.cpp
+++ b/src/encoding/cryptopp/asn_ext.cpp
@@ -8,14 +8,6 @@
 
 #include <ndn-cpp-dev/ndn-cpp-config.h>
 #include "asn_ext.hpp"
-
-#if NDN_CPP_HAVE_TIME_H
-#include <time.h>
-#endif
-#if NDN_CPP_HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
 #include "../../util/time.hpp"
 
 #include <boost/format.hpp>
@@ -33,17 +25,21 @@
   else if (time > 2e14)
     // 2e14 is about the year 8300.  We don't want to go over a 4-digit year.
     throw Asn::Error("Calendar time value out of range");
-  
-  time_t secondsSince1970 = time / 1000;
-  struct tm* gmt = gmtime(&secondsSince1970);
 
-  std::string asn1time ((boost::format("%04d%02d%02d%02d%02d%02dZ")
-                         % (1900 + gmt->tm_year)
-                         % (gmt->tm_mon + 1)
-                         % gmt->tm_mday
-                         % gmt->tm_hour
-                         % gmt->tm_min
-                         % gmt->tm_sec).str());
+
+  boost::posix_time::ptime boostTime =
+    UNIX_EPOCH_TIME + boost::posix_time::milliseconds(time);
+  
+  const boost::format f = boost::format("%04d%02d%02d%02d%02d%02dZ")
+                % boostTime.date().year_month_day().year
+                % boostTime.date().year_month_day().month.as_number()
+                % boostTime.date().year_month_day().day.as_number()
+                % boostTime.time_of_day().hours()
+                % boostTime.time_of_day().minutes()
+                % boostTime.time_of_day().seconds()
+    ;
+
+  std::string asn1time = f.str();
   
   bt.Put(GENERALIZED_TIME);
   size_t lengthBytes = DERLengthEncode(bt, asn1time.size());
diff --git a/src/name.cpp b/src/name.cpp
index 3e2d1fe..484fdc0 100644
--- a/src/name.cpp
+++ b/src/name.cpp
@@ -8,7 +8,7 @@
 
 #include <stdexcept>
 #include <algorithm>
-#include <string.h>
+#include <cstring>
 #include <ndn-cpp-dev/name.hpp>
 #include "util/time.hpp"
 
@@ -90,7 +90,7 @@
     return 1;
 
   // The components are equal length.  Just do a byte compare.  
-  return memcmp(getValue().buf(), other.getValue().buf(), getValue().size());
+  return std::memcmp(getValue().buf(), other.getValue().buf(), getValue().size());
 }
 
 // const Block &
diff --git a/src/util/logging.hpp b/src/util/logging.hpp
index 73c6d12..e9bf4d5 100644
--- a/src/util/logging.hpp
+++ b/src/util/logging.hpp
@@ -64,11 +64,10 @@
 
 #ifdef _DEBUG
 
-#include <sys/time.h>
 #include <iostream>
 
 #define _LOG_DEBUG(x) \
-  { time_t now = time(0); std::string s = std::string(ctime(&now)); std::clog << s.substr(0, s.size() - 1) << " " << x << std::endl; }
+  { std::clog << s.substr(0, s.size() - 1) << " " << x << std::endl; }
 
 #else
 #define _LOG_DEBUG(x)
diff --git a/src/util/time.cpp b/src/util/time.cpp
deleted file mode 100644
index 03eb81b..0000000
--- a/src/util/time.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#include <ndn-cpp-dev/ndn-cpp-config.h>
-#if NDN_CPP_HAVE_TIME_H
-#include <time.h>
-#endif
-#if NDN_CPP_HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <math.h>
-#include <string.h>
-#include <stdio.h>
-#include "time.hpp"
-
-namespace ndn {
-
-MillisecondsSince1970 
-ndn_getNowMilliseconds()
-{
-  struct timeval t;
-  // Note: configure.ac requires gettimeofday.
-  gettimeofday(&t, 0);
-  return t.tv_sec * 1000.0 + t.tv_usec / 1000.0;
-}
-
-int
-ndn_toIsoString(MillisecondsSince1970 milliseconds, char *isoString)
-{
-#if NDN_CPP_HAVE_GMTIME_SUPPORT
-  if (milliseconds < 0)
-    return -1;
-  else if (milliseconds > 2e14)
-    // 2e14 is about the year 8300.  We don't want to go over a 4-digit year.
-    return -1;
-  
-  double secondsSince1970 = milliseconds / 1000.0;
-  char fractionBuffer[10];
-  sprintf(fractionBuffer, "%.06lf", fmod(secondsSince1970, 1.0));
-  const char *fraction = strchr(fractionBuffer, '.');
-  if (!fraction)
-    // Don't expect this to happen.
-    fraction = ".000000";
-    
-  time_t seconds = (time_t)secondsSince1970;
-  struct tm* gmt = gmtime(&seconds);
-  sprintf(isoString, "%04d%02d%02dT%02d%02d%02d%s", 1900 + gmt->tm_year, gmt->tm_mon + 1, gmt->tm_mday,
-    gmt->tm_hour, gmt->tm_min, gmt->tm_sec, fraction);
-  
-  return 0;
-#else
-  return -1;
-#endif
-}
-
-int
-ndn_fromIsoString(const char* isoString, MillisecondsSince1970 *milliseconds)
-{
-#if NDN_CPP_HAVE_GMTIME_SUPPORT
-  // Initialize time zone, etc.
-  time_t dummyTime = 0;
-  struct tm tm1 = *gmtime(&dummyTime);
-  
-  sscanf(isoString, "%4d%2d%2dT%2d%2d", &tm1.tm_year, &tm1.tm_mon, &tm1.tm_mday, &tm1.tm_hour, &tm1.tm_min);
-  // Skip the time past minutes and get the float seconds.
-  double seconds;
-  sscanf(isoString + (4 + 2 + 2 + 1 + 2 + 2), "%lf", &seconds);
-  
-  // tm_year starts from 1900.
-  tm1.tm_year -= 1900;
-  // tm_mon starts from 0, not 1.
-  tm1.tm_mon -= 1;
-  tm1.tm_sec = 0;
-  
-  *milliseconds = (timegm(&tm1) + seconds) * 1000.0;
-  return 0;
-#else
-  return -1;
-#endif
-}
-
-} // namespace ndn
diff --git a/src/util/time.hpp b/src/util/time.hpp
index 5e5dc7c..7b42b4a 100644
--- a/src/util/time.hpp
+++ b/src/util/time.hpp
@@ -9,17 +9,28 @@
 #define NDN_TIME_HPP
 
 #include "ndn-cpp-dev/common.hpp"
+#include <boost/date_time/posix_time/posix_time.hpp>
 
 namespace ndn {
 
-MillisecondsSince1970 
-ndn_getNowMilliseconds();
+const boost::posix_time::ptime UNIX_EPOCH_TIME =
+  boost::posix_time::ptime (boost::gregorian::date (1970, boost::gregorian::Jan, 1));
 
-int
-ndn_toIsoString(MillisecondsSince1970 milliseconds, char *isoString);
+/**
+ * @brief Get the current time in milliseconds since 1/1/1970, including fractions of a millisecond
+ */
+inline MillisecondsSince1970 
+getNowMilliseconds()
+{
+  return (boost::posix_time::microsec_clock::universal_time() - UNIX_EPOCH_TIME).total_milliseconds();
+}
 
-int
-ndn_fromIsoString(const char* isoString, MillisecondsSince1970 *milliseconds);
+inline MillisecondsSince1970 
+ndn_getNowMilliseconds()
+{
+  return getNowMilliseconds();
+}
+
 
 /**
  * Convert to the ISO string representation of the time.
@@ -29,12 +40,13 @@
 inline std::string
 toIsoString(const MillisecondsSince1970& time)
 {
-  char isoString[25];
-  int error;
-  if ((error = ndn_toIsoString(time, isoString)))
-    throw std::runtime_error("toIsoString");
-  
-  return isoString;
+  boost::posix_time::ptime boostTime = UNIX_EPOCH_TIME + boost::posix_time::milliseconds(time);
+
+  /// @todo Determine whether this is necessary at all
+  if ((time % 1000) == 0)
+    return boost::posix_time::to_iso_string(boostTime) + ".000000"; 
+  else
+    return boost::posix_time::to_iso_string(boostTime);
 }
   
 /**
@@ -45,12 +57,9 @@
 inline MillisecondsSince1970
 fromIsoString(const std::string& isoString)
 {
-  MillisecondsSince1970 milliseconds;
-  int error;
-  if ((error = ndn_fromIsoString(isoString.c_str(), &milliseconds)))
-    throw std::runtime_error("fromIsoString");
+  boost::posix_time::ptime boostTime = boost::posix_time::from_iso_string(isoString);
   
-  return milliseconds;
+  return (boostTime-UNIX_EPOCH_TIME).total_milliseconds();
 }
 
 } // namespace ndn
