• DOCUMENTATION
  • WORKATO BLOG
  • PRODUCT BLOG
  • Return to Workato
  • Log in
  • ☰
  • Community/Discussions
Solution home Formula Mode Tips & Tricks Date/Time Formulas

How do I add or subtract days or months from dates?

Modified on: Thu, Aug 29, 2019 at 5:59 AM

Adding and Subtracting Dates:


You can add or subtract months, days, hours minutes or seconds from dates. Some scenarios might be:

  1. When creating an invoice in Xero, we wish to set the due date of the invoice to 30 days after the invoice has been sent
  2. When creating an opportunity in Salesforce, we wish to set the expected close date of the opportunity to 1 month after the opportunity has been created
  3. When creating a project in Replicon, we wish to set the expected end date of the project to 1 year after the opportunity has been created


The examples below use the datetime stamp 2019-08-15T12:00:00+0000


Operator

Addition Example

Addition Result

Subtraction Example

Subtraction result

months

[pill] + 1.months

2019-09-15T12:00:00+0000

[pill] - 5.months

2019-03-15T12:00:00+0000

days

[pill] + 2.days

2019-08-17T12:00:00+0000

[pill] - 4.days

2019-08-11T12:00:00+0000

hours

[pill] + 3.hours

2019-08-15T15:00:00+0000

[pill] - 3.hours

2019-08-15T09:00:00+0000

minutes

[pill] + 4.minutes

2019-08-15T12:04:00+0000

[pill] - 2.minutes

2019-08-15T11:58:00+0000

seconds

[pill] + 5.seconds

2019-08-15T12:00:05+0000

[pill] - 1.seconds

2019-08-15T11:59:59+0000


Note: Even if you are only adding or subtracting 1 unit of time (e.g. 1 hour, 1 day), you will need to indicate the unit in plural form, i.e. hours, days in formula mode. 

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

Related Articles

    Still can't find your solution?

    Visit our forums to search for answers, or post your own questions.

    Documentation
    Developer's Library
    Tutorials
    eBooks
    Product Hour
    Product Blog
    Workato Blog
    Product updates
    Customer Stories
    © Workato 2020   Privacy   Terms   +1 (844) 469-6752
    • Documentation
    • Workato Blog
    • Product Blog
    • Solutions
    • Forums
    • Tickets
    • Log in
    • Return to Workato
    Article views count