Add months to date field

[ad_1]

Hello @lauraabraham

Thank you very much for using our plugin. I’ll try to describe the process with a hypothetical example.

Assuming you have the date field, fieldname1 with date format “mm/dd/yyyy” (the date format is selected through the field’s settings), and you want to increase it in one month.

Insert a calculated field in the form and enter the equation:

GETDATETIMESTRING(DATETIMESUM(fieldname1, 'mm/dd/yyyy', 1, 'm'), 'mm/dd/yyyy')

You must read the DATETIMESUM operation as follows: take the fieldname1 value in ‘mm/dd/yyyy’ format and increase it in one month ('m'). The operation returns a date object, but as you want to display it into a calculated field, you must use the GETDATETIMESTRING operation to transform the object into a text with date/time format, in this case, 'mm/dd/yyyy'.

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer