diff --git a/rrecur.js b/rrecur.js
index <HASH>..<HASH> 100644
--- a/rrecur.js
+++ b/rrecur.js
@@ -118,6 +118,11 @@
       }
 
       if ('UNTIL' === k || 'DTSTART' === k) {
+        if ('number' === typeof v) {
+          v = new Date(v).toISOString();
+        } else if ('object' === typeof v) {
+          v = v.toISOString();
+        }
         v = v.replace(/\-|:/g, '').replace(/\.\d+/, '');
       }
fix #2 convert date object and integer timestamp to iso string for until and dtstart