Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
I put this in a Calculate Fields node (connected to a Create Data node). You can use this in a Transform also. Note you'll have to explicitly handle Null values.
dueDate + datetime.timedelta(days=30)
You're right that it does not take months. When you say add a month do you mean just move the month up one, i.e. today's value would become 2019-11-14?
If so you could do some if statement, or maybe a dict to store how many days you go forward based on the month You could also calculate the month (dueDate.month) value and add one. Here's an example of one way to go about it. This is not handling any Null dates date that could be in the data.
dueMonth = in1.dueDate.month
dueYear = in1.dueDate.year
if dueMonth == 9 or dueMonth == 4 or dueMonth == 6 or dueMonth == 11: # 30 day months
days = 30
elif dueMonth == 2 and dueYear % 4 == 0: # leap year
days = 29
elif dueMonth == 2:
days = 28
else:
days = 31
out1.NewDate = in1.dueDate + datetime.timedelta(days=days)