|
Previous Top Next |
Prototype: | (Date pDate, *ANY pFromDate, *ANY pToDate),LONG,PROC |
pDate | Base date to calculate from. |
pFromDate | Start date of the period. |
pToDate | End date of the period. |
Returns | Number of days in the period |
This method returns the start date and end date of the last/previous month based on the pDate base date. Leap years do not affect this method and neither do changes in years, i.e. if pDate is in January GetLastMonth will return the first and last dates for December 1 and 31 the year before.
Example:
ITD ITDateClass
FD Date
TD Date
D Date
Ds Long
Code
D = Today()
Ds = ITD.GetLastMonth(D,FD,TD)
ITD.ODS('GetLastMonth Date: ' & Format(D,@d18) & ', From: ' & Format(Format(FD,@d18),@s30) & 'To: ' & Format(Format(TD,@d18),@s30) & 'Days: ' & Ds)
See also: