ScriptPro Editor This topic is for use by scriptwriters who are using ScriptPro Editor to create custom scripts for their agencies. Agents can go to Using ScriptPro Scripts for more information about using custom or standard scripts within Travelport Smartpoint. |
Date Arithmetic
Date arithmetic allows the calculation of the number of days between two dates and provides the ability to add a number of days to, or subtract a number of days from, a date.
Note: In all examples below, any combination of date and airdate type can be used for date1 and date2 (e.g., newdate = date - airdate is a valid statement).
Example 1
newdate = date1 - date2
This statement gives the difference between date1 and date2 in days as the variable newdate. The date variables can be in either order; [date1 - date2] and [date2 - date1] both yield the same positive number.
Example 2
date1 = date2 + nbr_of_days
This statement adds a number of days to date2, then assigns that new date to date1.
Example 3
date1 = date2 - nbr_of_days
This statement subtracts a number of days from date2, then assigns that new date to date1.