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
Tag Archives: FT_WOY()
FT_YEAR
FT_YEAR()
Return calendar or fiscal year data
Syntax
FT_YEAR( [ <dGivenDate> ] ) -> aDateInfo
Arguments
<dGivenDate> is any valid date in any date format. Defaults
to current system date if not supplied.
Returns
A three element array containing the following data:
aDateInfo[1] - The year as a character string "YYYY"
aDateInfo[2] - The beginning date of the year
aDateInfo[3] - The ending date of the year
Description
FT_YEAR() returns an array containing data about the year
containing the given date.
Normally the return data will be based on a year beginning
on January 1st.
The beginning of year date can be changed by using FT_DATECNFG(),
which will affect all subsequent calls to FT_YEAR() until another
call to FT_DATECNFG().
The beginning of year date may be reset to January 1 by calling
FT_DATECNFG() with no parameters.
Examples
// Get info about year containing 9/15/90, assuming default
// beginning of year is January 1st.
aDateInfo := FT_YEAR( Ctod("09/15/90") )
? aDateInfo[1] // 1990
? aDateInfo[2] // 01/01/90 beginning of year
? aDateInfo[3] // 12/31/90 end of year
// get info about current year (1991).
aDateInfo := FT_YEAR()
? aDateInfo[1] // 1991
? aDateInfo[2] // 01/01/91 beginning of year
? aDateInfo[3] // 12/31/91 end of year
Source: YEAR.PRG
Author: Jo W. French dba Practical Computing
See Also: FT_DATECNFG() FT_WEEK() FT_MONTH() FT_QTR()
FT_WOY
FT_WOY()
Find number of week within year
Syntax
FT_WOY( <dDate> ) -> <nResult>
Arguments
<dDate> is a date in the form "mm/dd/yy" or "mm/dd/yyyy"
Returns
Return numeric position of week within the year or NIL if
parameter does not conform.
Description
Considers a full week as starting on Sunday, ending on Saturday.
First week of year (week 1) may start on any day, and thus
contain any number of days.
Final week of year (week 53) may contain any number of days.
Handles dates with CENTURY ON|OFF, to allow for 21st century.
Date validation must be external to this function.
Examples
These code fragments find the week number, given a date.
// literal character date
dDate := CTOD("01/01/91")
nWkNum := FT_WOY(dDate) // result: 1
// presume DOS date to be 01/06/91
nWkNum := FT_WOY(DATE()) // result: 2
// date input
cDate := SPACE(8)
@ 4,10 get cDate PICT "##/##/##" // input 07/04/91
READ
nWkNum := FT_WOY(CTOD(cDate)) // result: 27
// last day of year
nWkNum := FT_WOY(CTOD("12/31/91")) // result: 53
For a demonstration of this function, compile and link the
program WOY.PRG in the Nanforum Toolkit source code.
Source: WOY.PRG
Author: Forest Belt, Computer Diagnostic Services, Inc.