diff --git a/lib/cli.py b/lib/cli.py
index 87f049360b5654876d0144a3ec273bda9d9249f9..7947cc65c3d06761fb344cdbdff65cb6f98e110f 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -2986,8 +2986,9 @@ def FormatTimestamp(ts):
   """
   if not isinstance(ts, (tuple, list)) or len(ts) != 2:
     return "?"
-  sec, usec = ts
-  return time.strftime("%F %T", time.localtime(sec)) + ".%06d" % usec
+
+  (sec, usecs) = ts
+  return utils.FormatTime(sec, usecs=usecs)
 
 
 def ParseTimespec(value):
diff --git a/lib/utils/text.py b/lib/utils/text.py
index 0a0e68cebe1d18d3e1c146f7cca8cacad2e34d2f..e16a86138a4f366cc2541478618699ae825cc489 100644
--- a/lib/utils/text.py
+++ b/lib/utils/text.py
@@ -412,7 +412,7 @@ def CommaJoin(names):
   return ", ".join([str(val) for val in names])
 
 
-def FormatTime(val):
+def FormatTime(val, usecs=None):
   """Formats a time value.
 
   @type val: float or None
@@ -423,9 +423,15 @@ def FormatTime(val):
   """
   if val is None or not isinstance(val, (int, float)):
     return "N/A"
+
   # these two codes works on Linux, but they are not guaranteed on all
   # platforms
-  return time.strftime("%F %T", time.localtime(val))
+  result = time.strftime("%F %T", time.localtime(val))
+
+  if usecs is not None:
+    result += ".%06d" % usecs
+
+  return result
 
 
 def FormatSeconds(secs):
diff --git a/test/ganeti.cli_unittest.py b/test/ganeti.cli_unittest.py
index b5cbe7cc8e93bd8cc414e26d6d510f402ec85994..7185e171dd2a60cb245fd59a3c15ca964276800c 100755
--- a/test/ganeti.cli_unittest.py
+++ b/test/ganeti.cli_unittest.py
@@ -22,6 +22,7 @@
 """Script for unittesting the cli module"""
 
 import unittest
+import time
 from cStringIO import StringIO
 
 import ganeti
@@ -908,5 +909,18 @@ class TestGetOnlineNodes(unittest.TestCase):
     self.assertEqual(cl.CountPending(), 0)
 
 
+class TestFormatTimestamp(unittest.TestCase):
+  def testGood(self):
+    self.assertEqual(cli.FormatTimestamp((0, 1)),
+                     time.strftime("%F %T", time.localtime(0)) + ".000001")
+    self.assertEqual(cli.FormatTimestamp((1332944009, 17376)),
+                     (time.strftime("%F %T", time.localtime(1332944009)) +
+                      ".017376"))
+
+  def testWrong(self):
+    for i in [0, [], {}, "", [1]]:
+      self.assertEqual(cli.FormatTimestamp(i), "?")
+
+
 if __name__ == '__main__':
   testutils.GanetiTestProgram()
diff --git a/test/ganeti.utils.text_unittest.py b/test/ganeti.utils.text_unittest.py
index 5a9af02e7eba0459797cc2f385c1a77e4a240e5d..b787dc8b57cd9e0af2d0c5a91d61b743dbfdba2c 100755
--- a/test/ganeti.utils.text_unittest.py
+++ b/test/ganeti.utils.text_unittest.py
@@ -429,21 +429,25 @@ class TestFormatTime(unittest.TestCase):
   """Testing case for FormatTime"""
 
   @staticmethod
-  def _TestInProcess(tz, timestamp, expected):
+  def _TestInProcess(tz, timestamp, usecs, expected):
     os.environ["TZ"] = tz
     time.tzset()
-    return utils.FormatTime(timestamp) == expected
+    return utils.FormatTime(timestamp, usecs=usecs) == expected
 
   def _Test(self, *args):
     # Need to use separate process as we want to change TZ
     self.assert_(utils.RunInSeparateProcess(self._TestInProcess, *args))
 
   def test(self):
-    self._Test("UTC", 0, "1970-01-01 00:00:00")
-    self._Test("America/Sao_Paulo", 1292606926, "2010-12-17 15:28:46")
-    self._Test("Europe/London", 1292606926, "2010-12-17 17:28:46")
-    self._Test("Europe/Zurich", 1292606926, "2010-12-17 18:28:46")
-    self._Test("Australia/Sydney", 1292606926, "2010-12-18 04:28:46")
+    self._Test("UTC", 0, None, "1970-01-01 00:00:00")
+    self._Test("America/Sao_Paulo", 1292606926, None, "2010-12-17 15:28:46")
+    self._Test("Europe/London", 1292606926, None, "2010-12-17 17:28:46")
+    self._Test("Europe/Zurich", 1292606926, None, "2010-12-17 18:28:46")
+    self._Test("Europe/Zurich", 1332944288, 8787, "2012-03-28 16:18:08.008787")
+    self._Test("Australia/Sydney", 1292606926, None, "2010-12-18 04:28:46")
+    self._Test("Australia/Sydney", 1292606926, None, "2010-12-18 04:28:46")
+    self._Test("Australia/Sydney", 1292606926, 999999,
+               "2010-12-18 04:28:46.999999")
 
   def testNone(self):
     self.failUnlessEqual(utils.FormatTime(None), "N/A")