ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ· º DtUtil() * º º Class : Function º º Status: Production º º Owner : BHOWARD º ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ USAGE: DTUTIL(,@,) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ PURPOSE: General Date/Time manipulation utility. RETURN VALUE: Depends on argument This is a consolidation utility to perform a variety of commonly (and uncommonly) needed answers to Date and Time issues. The syntax is; =DTUTIL(,@,) required, contains action requested optional, contains date value (or a character value in date or time format) to manipulate. Current date is default if absent or .f. offset value, generally refers to a day of the week (Sun=1 Sat=7) but is also used to pass additional result requests. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Currently, the "options" for DTUTIL() are; WEEKS, BOM, EOM, BOW, WORD, REVERSE, GETMO, GETDAY, STRMO, STRDAY, 2CENT, ADDTIME, CALCTIME, WDAYS, AGE Most also use to further define the action required. For example, dtutil("BOM",,3) returns the date of the first Tuesday of the month. "WEEKS" Converts a passed date variable to a [6,2] array containing the beginning and end dates of each week in the month. =DTUTIL("WEEKS",@,) any date within the month that you need the week ranges for. This can be either a single character variable or an array variable as long as the first element of the array contains a date. (optional) is the number of days to offset the start of the week from Sunday (default). For example, if you want the weeks defined as starting on a Monday and ending on Sunday this would be a numeric "1" when passed as a value will be modified to a [6,2] array that will contain the beginning and end date of each week. If there is only one day in a week, dvar[x,1] and dvar[x,2] will contain the same date. In the event that weeks 5 and/or 6 are beyond the end of the month, those arrays will contain EMPTY dates. "BOM" (returns beginning of current or passed date month) If you use the argument "BOM" and pass an optional from 1-7 representing the day of the week (Sun=1 Sat=7) the date returned will be the date of the first occurance of that day in the current month or the month passed. "EOM" (returns end of current or passed date month) You may also use an optional to return the last occurance of a day within the month. "WORD" (returns a verbose character string for the current or passed date. Identical to WORDDATE() Pass an from 1-4 to trigger the various WORDDATE() formats.) "REVERSE" (returns a date variable when passed a verbose date string) Pass an value to select the same formats as WORDDATE() Pass 5 for date format used in INTERNET mail headers Pass 7 for a DTOS() format, including "19920130" "1943-01-20" "1942_19_07" Pass 8 for ddmmyyyy pass 9 for yyyy-mm-dd pass 10 for UNIX "Mon Apr 29 14:15:16 1997" pass 11 for UNIX "seconds since midnight GMT 1/1/1970" conversions etc. "GETMO" (returns the digital month when passed a word month) You can pass in the format "Jan, JAN, January" (minimum of three characters) and the return will be a character value. A "00" will be returned if a bad value was passed. "GETDAY" (returns the digital day of week when passed a word day) You can pass in the format "Mon, MON, Monday" (minimum of three characters) and the return will be a character value. A "00" will be returned if a bad value was passed. "STRMO" and "STRDAY" do the reverse... when passed a numeric value as