adding a day to a date

What is the way to add a day to a date?

For example, when I do: datetime(year(today()), month(today()), day(today()) + 1, 13), it doesn't work for the case when today() = last day of the month. For example, yesterday was the last day of the month (the 31st) and we had an issue because 31 + 1 is 32 and that day doesn't exist. What is the way to add a day so that the system figures out by itself that August 31st + 1 is September 1st and not August 32nd?

OriginalPostID-232448

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    over 6 years ago
    Hi erickp,

    Rather than adding 1 to "day" inside datetime() function, add 1 directly to the datetime() function directly as shown below. This might solve your problem.

    datetime(year(todate("8/31/2016")), month(todate("8/31/2016")), day(todate("8/31/2016")), 13)+1
Reply
  • 0
    Certified Lead Developer
    over 6 years ago
    Hi erickp,

    Rather than adding 1 to "day" inside datetime() function, add 1 directly to the datetime() function directly as shown below. This might solve your problem.

    datetime(year(todate("8/31/2016")), month(todate("8/31/2016")), day(todate("8/31/2016")), 13)+1
Children
No Data