FT Date-Time

 FT_ACCTADJ()     Adjust beginning or ending fiscal pd. dates to acctg. dates
 FT_ACCTMONTH()   Return accounting month data
 FT_ACCTQTR()     Return accounting quarter data
 FT_ACCTWEEK()    Return accounting week data
 FT_ACCTYEAR()    Return accounting year data
 FT_ADDWKDY()     Return true number of days to add given number of workdays
 FT_CALENDAR()    Display date/time calendar, find a date, return calendar data.
 FT_CIV2MIL()     Convert usual civilian format time to military time.
 FT_DATECNFG()    Set beginning of year/week for FT_ date functions
 FT_DAYOFYR()     Return calendar, fiscal or accounting day data
 FT_DAYTOBOW()    Calculate no. of days between date and beginning of week
 FT_DOY()         Find number of day within year
 FT_EASTER()      Return the date of Easter
 FT_ELAPMIN()     Return difference, in minutes, between two mil format times.
 FT_ELAPSED()     Return elapsed time between two days and/or times
 FT_ELTIME()      Compute difference between times in hours, minutes, seconds.
 FT_FDAY()        Return first day of the month
 FT_LDAY()        Return last day of the month
 FT_MADD()        Add or subtract months to/from a date
 FT_MIL2CIV()     Convert time in military format to civilian format.
 FT_MIL2MIN()     Convert time in military format to number of minute of day.
 FT_MIN2DHM()     Convert numeric minutes to days, hours and minutes.
 FT_MIN2MIL()     Convert minute of day to military format time.
 FT_MONTH()       Return Calendar or Fiscal Month Data
 FT_QTR()         Return Calendar or Fiscal Quarter Data.
 FT_SYS2MIL()     Convert system time to military time format.
 FT_WEEK()        Return calendar or fiscal week data
 FT_WORKDAYS()    Return number of work days between two dates
 FT_WOY()         Find number of week within year
 FT_YEAR()        Return calendar or fiscal year data

FT_ACCTADJ

FT_ACCTADJ()
 Adjust beginning or ending fiscal pd. dates to acctg. dates

 Syntax

      FT_ACCTADJ( [ <dGivenDate> ], [ <lIsEnd> ] ) -> dDate

 Arguments

     <dGivenDate> is any valid date in any valid format.
     Defaults to DATE() if not supplied.

     <lIsEnd> is a logical variable. .F. = adjust for beginning of
     period mode, .T. = adjust for end of period mode.  Defaults to
     beginning of period mode.

 Returns

     An adjusted date dependent upon mode and work week start day.

 Description

     Called by other FT_ACCT.. functions. The algorithm is:

     Beginning of period mode:

        If dGivenDate is in last 3 days of work week
           Return next week's start date
        Else
           Return this week's start date
        Endif

     End of period mode:

        If dGivenDate is in last 4 days of work week
           Return this week's end date
        Else
           Return prior week's end date
        Endif

 Examples

     Beginning of period mode (lIsEnd == .F.)

       dDate := Ctod( "01/31/91" )  // In last 3 days of work week
       ? FT_ACCTADJ( dDate )        // 02/03/91 (next week's start)

       dDate := Ctod( "03/31/91" )  // Not in last 3 days of work week
       ? FT_ACCTADJ( dDate )        // 03/31/91 (this week's start)

     End of period mode (lIsEnd == .T.)

       dDate := Ctod( "01/31/91" )  // In last 4 days of work week
       ? FT_ACCTADJ( dDate, .T. )   // 02/02/91 (this week's end)

       dDate := Ctod( "03/31/91" )  // Not in last 4 days of work week
       ? FT_ACCTADJ( dDate, .T. )   // 03/30/91 (prior week's end)

 Source: ACCTADJ.PRG

 Author: Jo W. French dba Practical Computing

See Also: FT_DATECNFG() FT_DAYTOBOW()