diff --git a/cbits/hstrptime.c b/cbits/hstrptime.c
--- a/cbits/hstrptime.c
+++ b/cbits/hstrptime.c
@@ -609,7 +609,7 @@
                     sval = our_wcstod(rp, &end);
                     if( sval >= 0.0 && sval <= 61.0) {
                         tm->tm_sec = sval;
-                        *psecs = sval;
+                        *psecs = sval - floor(sval);
                     }
                     rp = end;
                 }
@@ -1133,7 +1133,7 @@
                        sval = our_strtod(rp, &end);
                        if( sval >= 0.0 && sval <= 61.0) {
                            tm->tm_sec = sval;
-                           *psecs = sval;
+                           *psecs = sval - floor(sval);
                        }
                        rp = end;
                    }
diff --git a/include/hstrptime.h b/include/hstrptime.h
--- a/include/hstrptime.h
+++ b/include/hstrptime.h
@@ -46,6 +46,7 @@
 #include <time.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <math.h>
 
 #ifdef HAVE_STRINGS_H
 #include <strings.h>  /* for strncasecmp */
diff --git a/strptime.cabal b/strptime.cabal
--- a/strptime.cabal
+++ b/strptime.cabal
@@ -1,6 +1,6 @@
 Name: strptime
 Category: System, Data, Parsing
-Version: 1.0.0
+Version: 1.0.1
 Cabal-version: >= 1.2
 Build-type: Simple
 Copyright: Eugene Kirpichov
