www.icetips.com  Icetips Utilities Documentation 11/14/2010    

Date Class: GetWeekFirstDay

Previous  Top  Next  


Prototype: (Date pStartDate, Long pWeek),Long

 

pStartDateBase date to calculate from.
pWeekWeek to move to forward or backward.  This can be negative, zero or positive number.  Negative number moves backward, 0 returns the first day of the current week and positive number moved forward. 

 

ReturnsThe first day of the specified week

 

This method will return the first day of a specified week, which can be in the past, present or future compared to the pStartDate.  For example to get the first day of last week, you would use -1 as the pWeek parameter.  To get next week's first day, you would use 1.

 

Example:

ITD  ITDateClass

FD   Date

D    Date

Code

D = Date(7,28,2010)

ITD.SetWeekStartDay(IT_Sunday)  !! Set the first day of the week to Sunday

 

FD = ITD.GetWeekFirstDay(D,-1)

ITD.ODS('First day -1: ' & Format(FD,@d18))  !! July 18, 2010

 

FD = ITD.GetWeekFirstDay(D,0)

ITD.ODS('First day 0: ' & Format(FD,@d18))   !! July 25, 2010

 

FD = ITD.GetWeekFirstDay(D,1)

ITD.ODS('First day 1: ' & Format(FD,@d18))   !! August 01, 2010

 

 

See also:

SetWeekStartDay

GetWeekStartDay

 



Direct link to this page: http://www.icetips.com/manuals/utilities/getweekfirstday_dateclass.htm