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
