ADDMONTH() Adds or subtracts months to/from a date ------------------------------------------------------------------------------ Syntax ADDMONTH([<dDate>], [<nMonth>]) --> dNewDate Arguments <dDate> Designates the date to which the <nMonth> months is added. The default is the system date. <nMonth> Designates the number of months to add to <dDate>. Returns ADDMONTH() returns the new date after <nMonth> is added to <dDate>. Description Use this function to calculate payment due dates based on an invoice date and for similar applications. It permits you to add months to a given date. If you use a negative number, months are subtracted. Note . An empty date parameter will result in an empty date. Examples * Show today's date, plus 36 months: ? "The payment period ends on: ", ADDMONTH(36) * Today plus 7 month: ? "AddMonth( 7 ) :", AddMonth( 7 ) * Date of last day of 7 month after : ? "EOM( AddMonth( 7 ) ) :", EOM( AddMonth( 7 ) ) * Dates of next year: dDate := CTOD( "12.12.2012" ) ? "Last day of one month after", dDate, ":", EOM( AddMonth( dDate, 1 ) ) ? "Last day of two month after", dDate, ":", EOM( AddMonth( dDate, 2 ) ) * Month before ? "Date of two month before", dDate, ":", AddMonth( dDate, -2 ) ?
Tag Archives: ADDMONTH
Tools — Date/Time Functions
Introduction Date/Time Functions ADDMONTH() 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.