Edit

CalcDueDate (date, terms)

Result Type: Date

Definition: Adds the terms to the date. For a positive value of terms, that number of days is added to date. For a negative value of terms (-1...-31), the calculated due date is the (absolute value of the) day of the month following. If the month does not have that many days, the day is limited to the number of days in the month. For negative values in the range (-101...-131) the due date will be the (mod 100) day of month in the second month following. For negative values in the range (-201...-231) the due date will be the day of month in the second month following.

Examples:  CalcDueDate('1/1/2024', -20)

returns '20/2/2024'.

CalcDueDate('1/1/2024', 30)

returns '31/1/2024'.

CalcDueDate('1/1/2024', -120)

returns '20/03/2024'.

See Also:

CurrentPeriod: Get the current period number

Date: Convert d,m,y to a date

DateToPeriod: Convert a date to a period

DateToText: Format a date as a string

Day: Get the Day of month of a date

DayOfWeek: Get The weekday of a date

FirstUnlockedPeriod: Get the oldest period that is not locked

Month: Get the month of a date

PeriodName: Get the Name of a period

PeriodOffset: Difference between two periods

PeriodToDate: Get the end date of a period

TextToDate: Parse a string to a date

Time: The current Datetime

TimeAdd: Add seconds to a DateTime

TimeDiff: The difference, in seconds, between two DateTimes

Timestamp: A timestamp string

Today: Today's date

WeekOfYear: Convert a date to a week number

Year: Year of a date