LassoScript Utility
Basics Browse Detail

[Date->Difference]

Tag Link [Date->Difference] Category Date
Type Member Source Available No
Support Preferred Version 6.0
Change Unchanged Data Source Any
Output Type Duration, Integer Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0

Description

[Date->Difference] determines the duration time between two Lasso dates.

The first parameter is a Lasso date data type that has been cast using the [Date] tag. The second parameter is a later Lasso date data type that has been cast using the [Date] tag. The second parameter is subtracted from the first and the output is a Lasso duration in hh:mm:ss format.

Optional parameters may be used to ouput a specified integer time value instead of a duration: -Millisecond, -Second, -Minute, -Hour, -Day, -Week, -Month, -Year. Lasso rounds to the nearest integer when using these optional parameters.

Syntax

[(Date)->Difference:(Date)]
[(Date)->(Difference:(Date), -Year)]
[(Date)->(Difference:(Date), -Month)]
[(Date)->(Difference:(Date), -Week)]
[(Date)->(Difference:(Date), -Day)]
[(Date)->(Difference:(Date), -Hour)]
[(Date)->(Difference:(Date), -Minute)]
[(Date)->(Difference:(Date), -Second)]
[(Date)->(Difference:(Date), -Millisecond)]

Parameters

Optional Parameters
-Millisecond Outputs an integer number of milliseconds between two dates.
-Second Outputs an integer number of seconds between two dates.
-Minute Outputs an integer number of minutes between two dates.
-Hour Outputs an integer number of hours between two dates.
-Week Outputs an integer number of weeks between two dates.
-Month Outputs an integer number of months between two dates.
-Year Outputs an integer number of years between two dates.
-Day Outputs an integer number of days between two dates.

Examples

To determine the duration between two dates:

The following examples show how to calculate the time difference between two dates and return a duration.

[Var: 'MyDate'=(Date:'5/22/2002')]
[$MyDate->(Difference: (Date: '5/15/2002 01:30:00'))]

-166:30:00