diff --git a/htar.cabal b/htar.cabal
--- a/htar.cabal
+++ b/htar.cabal
@@ -1,12 +1,12 @@
 name:            htar
-version:         0.4
+version:         0.4.0.1
 license:         BSD3
 license-File:    LICENSE
 author:          Bjorn Bringert <bjorn@bringert.net>
                  Duncan Coutts <duncan@community.haskell.org>
 maintainer:      Duncan Coutts <duncan@community.haskell.org>
 copyright:       2007 Bjorn Bringert <bjorn@bringert.net>
-                 2008-2012 Duncan Coutts <duncan@community.haskell.org>
+                 2008-2015 Duncan Coutts <duncan@community.haskell.org>
 category:        Codec
 synopsis:        Command-line tar archive utility.
 description:     A Command-line utility to create, extract and list the
@@ -19,17 +19,23 @@
 build-type:      Simple
 cabal-version:   >= 1.6
 
+flag old-locale
+
 executable htar
   main-is: htar.hs
   ghc-options: -Wall
   build-depends:
     base       == 4.*,
-    old-time   >= 1.0,
-    old-locale >= 1.0,
+    time       >= 1.1,
     directory  >= 1.0,
     filepath   >= 1.0,
     bytestring >= 0.9,
     tar        == 0.4.*,
-    zlib       >= 0.4 && < 0.6,
-    bzlib      >= 0.4 && < 0.6
+    zlib       >= 0.4 && < 0.7,
+    bzlib      >= 0.4 && < 0.7
+
+  if flag(old-locale)
+    build-depends: time < 1.5, old-locale >= 1.0
+  else
+    build-depends: time >= 1.5
 
diff --git a/htar.hs b/htar.hs
--- a/htar.hs
+++ b/htar.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 module Main where
 
 import qualified Codec.Archive.Tar       as Tar
@@ -16,8 +17,13 @@
 import System.Environment    (getArgs)
 import System.Exit           (exitFailure)
 import System.IO             (hPutStrLn, stderr)
+import Data.Time             (formatTime)
+import Data.Time.Clock.POSIX (posixSecondsToUTCTime)
+#if MIN_VERSION_time(1,5,0)
+import Data.Time             (defaultTimeLocale)
+#else
 import System.Locale         (defaultTimeLocale)
-import System.Time           (ClockTime(..), toUTCTime, formatCalendarTime)
+#endif
 
 main :: IO ()
 main = do
@@ -118,11 +124,7 @@
 
 formatEpochTime :: String -> Tar.EpochTime -> String
 formatEpochTime f =
-    formatCalendarTime defaultTimeLocale f . toUTCTime . epochTimeToClockTime
-
-epochTimeToClockTime :: Tar.EpochTime -> ClockTime
-epochTimeToClockTime e = TOD s (truncate (1000000000 * f))
-    where (s,f) = properFraction (toRational e)
+    formatTime defaultTimeLocale f . posixSecondsToUTCTime . fromIntegral
 
 ------------------------
 -- Command line handling
