Close
Close window
NextWeekday - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

Finance

NextWeekday

advance the given date to the next given day of the week

Calling Sequence

NextWeekday(date, weekday)

Parameters

date

-

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

weekday

-

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

opts

-

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

Options

The opts argument can contain one or more of the options shown below.

output = data or formatted -- Specify the type of output the NextWeekDay command should return. If this option is set to data (default) the record containing the data information will be returned. Otherwise the data will be formatted using the format deduced from the original date.

Description

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 a name, a string, or an integer between 1 and 7. When using an integer, 1 represents Sunday, 2 represents Monday, etc.

Examples

>

withFinance:

Return the first Monday that follows December 8, 2006.

>

NextWeekdayDecember 8, 2006,Monday,output=formatted

December 11, 2006

(1)
>

NextWeekdayDecember 8, 2006,Monday

11,12,2006

(2)
>

lprintNextWeekdayDecember 8, 2006,Monday

[11, 12, 2006]

>

NextWeekdayDecember 8, 2006,Mon,output=formatted

December 11, 2006

(3)
>

NextWeekdayDecember 8, 2006,2,output=formatted

December 11, 2006

(4)

Note that December 8, 2006 is already Friday.

>

NextWeekdayDecember 8, 2006,Friday,output=formatted

December 8, 2006

(5)

Compatibility

The Finance[NextWeekday] command was introduced in Maple 15.

For more information on Maple 15 changes, see Updates in Maple 15 .


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /