LassoScript Utility
Basics Browse Detail

[Date_Add]

Tag Link [Date_Add] Category Date
Type Substitution Source Available No
Support Preferred Version 3.0
Change Unchanged Data Source Any
Output Type Date Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x

Description

[Date_Add] adds a specified number of weeks, days, hours, minutes, or seconds to a base date value. The first parameter should be a Lasso date data type or valid Lasso date string. Subsequent keyword/value parameters define what should be added to the first parameter: -Second, -Minute, -Hour, -Day, -Week, -Month, or -Year.

Syntax

[Date_Add: (Date),
-Year=Integer,
-Month=Integer,
-Week=Integer,
-Day=Integer,
-Hour=Integer,
-Minute=Integer,
-Second=Integer]

[Date_Add: 'mm/dd/yyyy',
-Year=Integer,
-Month=Integer,
-Week=Integer,
-Day=Integer,
-Hour=Integer,
-Minute=Integer,
-Second=Integer]

Parameters

Required Parameters
Base Date Must be a Lasso date data type or valid Lasso date string.
Optional Parameters
-Second Specifies the number of seconds to add to the specified date.
-Minute Specifies the number of minutes to add to the specified date.
-Hour Specifies the number of hours to add to the specified date.
-Day Specifies the number of days to add to the date.
-Week Specifies the number of weeks to add to the date.
-Month Specifies the number of calendar months to add to the date.
-Year Specifies the number of calendar years to add to the date.

Change Notes

The -Month and -Year parameters were added in Lasso 7.

Examples

To calculate the time 4 hours from the current time:

Use the [Date_Add] tag to add 4 hours to the current date. The return value will be the current date with the time set to 4 hours from now.

[Date_Add: (Date), -Hour=4]

6/26/2001 4:12:32