diff --git a/Text/XML/XSD/DateTime.hs b/Text/XML/XSD/DateTime.hs
--- a/Text/XML/XSD/DateTime.hs
+++ b/Text/XML/XSD/DateTime.hs
@@ -132,7 +132,7 @@
                    char '-'
                    mm <- p2imax 12
                    char '-'
-                   dd <- p2imax ([31, if isLeapYear (fromIntegral mm) then 29 else 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] !! (mm - 1))
+                   dd <- p2imax ([31, if isLeapYear (fromIntegral yy) then 29 else 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] !! (mm - 1))
                    char 'T'
                    hhh <- p2imax 23
                    char ':'
diff --git a/xsd.cabal b/xsd.cabal
--- a/xsd.cabal
+++ b/xsd.cabal
@@ -1,5 +1,5 @@
 Name:                xsd
-Version:             0.3.3
+Version:             0.3.4.1
 License:             BSD3
 License-File:        LICENSE
 Synopsis:            XML Schema data structures
@@ -17,9 +17,9 @@
 
 Library
   if flag(small_base)
-    Build-Depends: base < 5 && >= 3, parsec, time
+    Build-Depends: base < 5 && >= 3, parsec, time >= 1.2.0.3
   else
-    Build-Depends: base < 5 && >= 3, parsec, time
+    Build-Depends: base < 5 && >= 3, parsec, time >= 1.2.0.3
 
   GHC-Options:    -Wall
   Exposed-Modules: Text.XML.XSD
