advance the given date to the next given day of the week - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Mathematics : Finance : Date Arithmetic : Finance/NextWeekday

Finance[NextWeekday] - advance the given date to the next given day of the week

Calling Sequence

NextWeekday(date, weekday)




a string containing a date specification in a format recognized by ParseDate or a date data structure



Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sun, Mon, Tue, Wed, Thu, Fri, Sat, or an integer between 1 and 7; weekday



(optional) equation(s) of the form option = value where option is output; specify options for the NextWeekday command



The NextWeekday command returns the first date that follows the given date and falls on the given day of the week. If the specified date already falls on the specified day of the week, the date itself will be returned.


The parameter date must be a date given in one of the formats recognized by the ParseDate command.


The parameter weekday is the weekday of interest. It can be given either as a name or as an integer between 1 and 7. In the latter case, 1 represents Sunday, 2 represents Monday, etc.



Return the first Monday that follows December 8, 2006.

NextWeekdayDecember 8, 2006,Monday,output=formatted

December 11, 2006


NextWeekdayDecember 8, 2006,Monday



Note that the last command returned a date data structure. It is printed as a string.

lprintNextWeekdayDecember 8, 2006,Monday

[11, 12, 2006]

NextWeekdayDecember 8, 2006,Mon,output=formatted

December 11, 2006


NextWeekdayDecember 8, 2006,2,output=formatted

December 11, 2006


Note that December 8, 2006 is already Friday.

NextWeekdayDecember 8, 2006,Friday,output=formatted

December 8, 2006


See Also

Finance[AddHoliday], Finance[AdjustDate], Finance[Calendar], Finance[Calendars], Finance[IsBusinessDay], Finance[IsEndOfMonth], Finance[IsHoliday], Finance[JoinBusinessDays], Finance[JoinHolidays], Finance[NthWeekday], Finance[RemoveHoliday]

Download Help Document

Was this information helpful?

Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam