<dDate> Designates a date for which the week it lies in, is determined. The default is the system date.
<lSWN> Simple Week Number ( see below description )
WEEK() returns a sequential week number that designates in which week of the year <dDate> lies.
Week() returns the calendar week a number. If no date is specified, the system date is used. An empty date via hb_SToD(“”) returns 0. The week of the year in which a day lies is information required by a number of technical financial calculations or wage accounting. This function determines this week and acknowledged all calendar rules. If <lSWN> is .T., Week() will calculate the “simple week number”, defined by – week #1 starts on January, 1st – week #(n+1) starts seven days after start of week #n If <lSWN> is .F. (default), the ISO8601 week number, defined by – weeks start on mondays – week #1 is the one that includes January, 4 will be calculated.
. When no date is specified, then WEEK() uses the system date. An empty date leads to a 0 result.
Determine the week for a date:
dDate := CTOD("03/14/92")
? "This date is in week: ", WEEK(dDate)
Week() is compatible with CT3’s Week(). <lSWN> is Harbour extention.
<nWeekday> Designates a weekday number from 1 to 7.
NTOCDOW() returns a name that corresponds to its weekday number.
This function converts a weekday number into the corresponding name. Sunday is 1, Monday is 2, Saturday is 7. If you pass a number outside of this range, the function returns a 0 value. Example In English Harbour returns: ? NTOCDOW(1) // “Sunday” ? NTOCDOW(4) // “Wednesday” ? NTOCDOW(7) // “Saturday” ? NTOCDOW(8) // “”
. Function operation depends on the country-specific adaptation of your Harbour compiler. With an English version of Harbour, only English day names are returned.
Introduction Date/Time FunctionsADDMONTH() Adds or subtracts months to/from a date
BOM() Determines the date of the first day of a month
BOQ() Determines the date for the beginning of a quarter
BOY() Determines the date for the beginning of a year
CTODOW() Converts the day of the week name into a corresponding number
CTOMONTH() Converts the name of the month into a corresponding number
DMY() Returns a date in "DD Month YY" format
DOY() Determines the day of the year for a specific date
EOM() Determines the date for the last day of a month
EOQ() Determines the date for the end of a quarter
EOY() Determines the date for the end of the year
ISLEAP() Tests if a specific year is a leap year
LASTDAYOM() Determines the number of days in a month
MDY() Returns a date in the "Month DD, YY" format
NTOCDOW() Changes the number of a weekday into a weekday name
NTOCMONTH() Changes the number of a month into a month name
QUARTER() Determines the quarter in which a specific date lies
SECTOTIME() Converts seconds into a time string
SETDATE() Sets the system date
SETTIME() Sets the system clock
SHOWTIME() Continuously displays the time at desired screen position
STOD() Converts an ANSI date string into Clipper format
TIMETOSEC() Calculates the seconds since midnight
TIMEVALID() Determines whether a specified time is valid
WAITPERIOD() Pauses a specified time in increments of 1/100 seconds
WEEK() Returns the calendar week for a date
WOM() Returns the week within a month.