diff --git a/expconfig.py b/expconfig.py
index 52c6c41baf1c8c4e9ad7b67f71ed0191907cd932..0cf64cc9a0652313190f3ddc22cf95af8616b0a9 100644
--- a/expconfig.py
+++ b/expconfig.py
@@ -139,10 +139,20 @@ class ExpConfig(ConfigObj):
             match = re.match(r'^0*(\d+)-0*(\d+)-0*(\d+)'
                              r'([T ]0*(\d+)(:0*(\d+)(:0*(\d+))?)?)?$', value)
             if match:
-                numbers = match.groups('0')
-            else:
-                raise ValueError("invalid date/time '{0}'".format(value))
-            return [numbers[i] for i in [0,1,2,4,6,8]]
+                return [match.groups('0')[i] for i in [0,1,2,4,6,8]]
+
+            match = re.match(r'^0*(\d+?)(\d{2})(\d{2})'
+                             r'([T ]0*(\d+)(:0*(\d+)(:0*(\d+))?)?)?$', value)
+            if match:
+                return [match.groups('0')[i] for i in [0,1,2,4,6,8]]
+                
+            raise ValueError("invalid date/time '{0}'".format(value))
+
+        def add_years(value, years):
+            '''Add specified number of years (possible negative) to date'''
+            years = int(years)
+            dt = map(int, split_date(value))
+            return "{0:04}-{1:02}-{2:02}".format(dt[0]+years, dt[1], dt[2])
 
         def eval_value(value):
             '''
@@ -179,6 +189,10 @@ class ExpConfig(ConfigObj):
             if match:
                 return eval_value_string(match.group(1))
 
+            match = re.match(r'^add_years\(\s*([-\d]+([T ][\d:]+)?)\s*,\s*([-+]?\d+)\s*\)$', value, re.S)
+            if match:
+                return add_years(match.group(1), match.group(3))
+
             match = re.match(r'^split_date\((.*)\)$', value, re.S)
             if match:
                 return split_date(match.group(1))
diff --git a/test.py b/test.py
index 86b47e813baf7115839d0641500cfa52397e1550..ea712ad6dca9cb51d4d5786af77892a300132cee 100644
--- a/test.py
+++ b/test.py
@@ -234,6 +234,60 @@ class ContentTestCase(MkexpTestCase):
         result = align(result)
         self.assertMultiLineEqual(expected, result)
 
+    def test_split_date(self):
+        exp_id = 'test_split_date'
+        job_id = 'job'
+        writeconfig(exp_id, """
+            EXP_TYPE =
+            DATE_ISO = 1234-05-06
+            DATE_RAW = 12340506
+            DATE_LIST_ISO = split_date($DATE_ISO)
+            DATE_LIST_RAW = split_date($DATE_RAW)
+            [jobs]
+              [["""+job_id+"""]]
+        """)
+        writetemplate(exp_id, job_id, """
+            %{DATE_LIST_ISO|join(',')}
+            %{DATE_LIST_RAW|join(',')}
+        """)
+        expected = align("""
+            1234,5,6,0,0,0
+            1234,05,06,0,0,0
+        """)
+        ignore = output(script("mkexp "+exp_id+".config"))
+        result = readfile(join("test", "experiments", exp_id, exp_id+"."+job_id))
+        result = align(result)
+        self.assertMultiLineEqual(expected, result)
+
+    def test_add_years(self):
+        exp_id = 'test_add_years'
+        job_id = 'job'
+        writeconfig(exp_id, """
+            EXP_TYPE =
+            DATE = 1234-05-06
+            NEXT_DATE = 'add_years($DATE, 1)'
+            PREVIOUS_DATE = 'add_years($DATE, -1)'
+            NEGATIVE_DATE = 'add_years($DATE, -2000)'
+            LONGYEAR_DATE = 'add_years($DATE, 10000)'
+            [jobs]
+              [["""+job_id+"""]]
+        """)
+        writetemplate(exp_id, job_id, """
+            %{NEXT_DATE}
+            %{PREVIOUS_DATE}
+            %{NEGATIVE_DATE}
+            %{LONGYEAR_DATE}
+        """)
+        expected = align("""
+            1235-05-06
+            1233-05-06
+            -766-05-06
+            11234-05-06
+        """)
+        ignore = output(script("mkexp "+exp_id+".config"))
+        result = readfile(join("test", "experiments", exp_id, exp_id+"."+job_id))
+        result = align(result)
+        self.assertMultiLineEqual(expected, result)
 
 if __name__ == '__main__':
     unittest.main()