Lasso Soft Inc. > Home

[Date_Difference]

[Date_Difference] calculates the difference between two dates and returns the results in either seconds, minutes, hours, days, or weeks between the two dates.

The first two parameters can be either Lasso date data types or valid Lasso date strings. The second parameter is subtracted from the first parameter and the result is returned as an integer in specified units: -Second, -Minute, -Hour, -Day, -Week. Lasso rounds to the nearest integer when using these optional parameters.

  • Syntax
  • Parameters
[Date_Difference: 'Base Date', 'Second Date', -Second]

[Date_Difference: 'Base Date', 'Second Date', -Minute]

[Date_Difference: 'Base Date', 'Second Date', -Hour]

[Date_Difference: 'Base Date', 'Second Date', -Day]

[Date_Difference: 'Base Date', 'Second Date', -Week]

[Date_Difference: (Date), (Date]
Required Parameters
Base Date The starting date from which the difference is calculated.
Second Date The ending date from which the difference is calculated.
Optional Parameters
Result Type The units of the result.
-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.
Examples

To calculate the difference between two dates:

Use the [Date_Difference] tag to calculate the difference between two dates. The following example returns the difference between two dates in several different formats.

<br>[Date_Difference: '12/26/2001', '12/25/2001', -Week]
<br>[Date_Difference: '12/26/2001', '12/25/2001', -Day]
<br>[Date_Difference: '12/26/2001', '12/25/2001', -Hour]
<br>[Date_Difference: '12/26/2001', '12/25/2001', -Minute]
<br>[Date_Difference: '12/26/2001', '12/25/2001', -Second]
Result:
<br>0
<br>1
<br>24
<br>1440
<br>86400
Tag Link [Date_Difference] Category Date
Type Substitution Data Source Any
Support Preferred Version 3.0
Output Type Duration, Integer Security None
Implementation LCAPI Sets Lasso 7.0, Lasso 6.0, Lasso 5.0,LDML3x

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