DayRange

DayRange[date1, date2]
gives the dates in the range from to .

DayRange[date1, date2, daytype]
gives the dates in the range from to that are of the specified daytype.

Details and OptionsDetails and Options

  • Dates can be specified in the following forms:
  • {y,m,d}year, month, day
    {y,m}the first day of the specified month
    {y}the first day of the first month of the year y
    "string"date as a string ()
  • Possible day types are: All (default); ; ; Monday through Sunday; ; ; and .
  • DayRange takes the following options:
  • CalendarType"Gregorian"calendar in which the dates have been specified
    HolidayCalendar{"UnitedStates","Default"}holiday schedule and subspecification for the business day and holiday computations
    "IncludeEndPoints"{True,True}whether and are to be included in the range
  • In the Jewish calendar, the weekdays are Sunday through Thursday.

ExamplesExamplesopen allclose all

Basic Examples (4)Basic Examples (4)

Print all the dates in a date range:

In[1]:=
Click for copyable input
Out[1]=

Print all dates that fall on a given day of the week:

In[1]:=
Click for copyable input
Out[1]=

Print all business days in the date range:

In[1]:=
Click for copyable input
Out[1]=

Print all holidays in the current year, subject to the default holiday schedule:

In[1]:=
Click for copyable input
Out[1]=
New in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »