public static int DaysBetweenDates( this int fromDate, int toDate ) public static int DaysBetweenDates( this string fromDate, string toDate ) public int DaysBetweenDates( int fromDate, int toDate ) public int DaysBetweenDates( string fromDate, string toDate )
using System; using WealthLab;public class DBDates: WealthScript { protected override void Execute() { string begDate = "20040112"; string endDate = "20080125"; int iBegDate = 20040112; int iEndDate = 20080125; PrintDebug( begDate.DaysBetweenDates( endDate ) ); PrintDebug( iBegDate.DaysBetweenDates( iEndDate ) ); } }
using System; using WealthLab; using Community.Components; // DaysBetweenDates here /*** Requires installation of Community.Components Extension from www.wealth-lab.com > Extensions ***/public class DBDates: WealthScript { protected override void Execute() { // Create an instance of class that holds the method Calculate calc = new Calculate(this); // pass WealthScript as "this" string begDate = "20040112"; string endDate = "20080125"; int iBegDate = 20040112; int iEndDate = 20080125; PrintDebug( calc.DaysBetweenDates( begDate, endDate ) ); PrintDebug( calc.DaysBetweenDates( iBegDate, iEndDate ) ); } }