diff --git a/src/System/PosixCompat/Files.hsc b/src/System/PosixCompat/Files.hsc
--- a/src/System/PosixCompat/Files.hsc
+++ b/src/System/PosixCompat/Files.hsc
@@ -139,6 +139,7 @@
 import System.Win32.File hiding (getFileType)
 import System.Win32.HardLink (createHardLink)
 import System.Win32.Time (FILETIME(..), getFileTime, setFileTime)
+import System.Win32.Types (HANDLE)
 
 import System.PosixCompat.Internal.Time (
       getClockTime, clockTimeToEpochTime
@@ -452,7 +453,7 @@
 setFileTimes file atime mtime =
   bracket openFileHandle closeHandle $ \handle -> do
     (creationTime, _, _) <- getFileTime handle
-    setFileTime
+    setFileTimeCompat
       handle
       creationTime
       (epochTimeToFileTime atime)
@@ -471,6 +472,14 @@
       where
         ll :: Int64
         ll = fromIntegral t * 10000000 + 116444736000000000
+
+setFileTimeCompat :: HANDLE -> FILETIME -> FILETIME -> FILETIME -> IO ()
+setFileTimeCompat h crt acc wrt =
+#if MIN_VERSION_Win32(2, 12, 0)
+    setFileTime h (Just crt) (Just acc) (Just wrt)
+#else
+    setFileTime h crt acc wrt
+#endif
 
 touchFile :: FilePath -> IO ()
 touchFile name =
diff --git a/unix-compat.cabal b/unix-compat.cabal
--- a/unix-compat.cabal
+++ b/unix-compat.cabal
@@ -1,5 +1,5 @@
 name:           unix-compat
-version:        0.5.3
+version:        0.5.4
 synopsis:       Portable POSIX-compatibility layer.
 description:    This package provides portable implementations of parts
                 of the unix package. This package re-exports the unix
@@ -57,7 +57,7 @@
       else
         build-depends: directory == 1.1.*
     else
-      build-depends: time >= 1.0 && < 1.10
+      build-depends: time >= 1.0 && < 1.13
       build-depends: directory >= 1.2 && < 1.4
 
     other-modules:
