Lasso Soft Inc. > Home

[ Date->Add ]

Method

[Date->Add] adds a duration to a Lasso date object. This method modifies the date object but does not output a value.

The first parameter is a Lasso date data type that has been cast using the [Date] method. The second parameter is a valid Lasso duration data type that has been cast using the [Duration] method.

Optional parameters may be used in place of a duration to define what should be added to the first parameter: -Millisecond, -Second, -Minute, -Hour, -Day, -Week, -Month, or -Year.

  • Syntax
Date Object->add(Duration)
Date Object->add(-year=Integer)
Date Object->add(-month=Integer)
Date Object->add(-week=Integer)
Date Object->add(-day=Integer)
Date Object->add(-hour=Integer)
Date Object->add(-minute=Integer)
Date Object->add(-second=Integer)
Date Object->add(-millisecond=Integer)
Examples
  • Beginner

To add a duration to a specified date:

Use the [Date->Add] method. The following example shows the result of adding a duration to a date.

Code

local('d') = date('2011-02-21')
#d->add(-year=1, -week=1, -day=1, -hour=1, -minute=1, -second=1)
#d

Result

2012-02-29 04:01:01

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft