DayMatchQ

DayMatchQ[date,daytype]

returns True if the date matches the daytype specification and returns False otherwise.

Details and Options

  • A date can be specified in the following forms:
  • DateObject[]date object
    {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 ("Jan. 1, 2000")
  • Possible day types are: All (default), "Weekday", "Weekend", Monday through Sunday, "EndOfMonth", "BeginningOfMonth", "BusinessDay", and "Holiday".
  • DayMatchQ takes the following options:
  • CalendarType "Gregorian"calendar in which the date has been specified
    HolidayCalendar {"UnitedStates","Default"}holiday schedule and subspecification for the business day and holiday computations
  • In the Jewish calendar, the weekdays are Sunday through Thursday.

Examples

open allclose all

Basic Examples  (5)

Find out if today is a weekend day:

Find out if today is a business day:

Find out if today is a non-weekend holiday:

Find out if July 4 is a holiday in Brazil:

Or in the US:

Scope  (2)

Input the date in string form:

What fraction of the time non-weekend holidays occur on Mondays:

Options  (3)

CalendarType  (1)

A day type will vary depending on the calendar associated with the date:

HolidayCalendar  (2)

The holiday calendar determines which days qualify as "Holiday":

Different markets within a country may have different holiday schedules:

Applications  (1)

Find the countries in this list for which Easter Monday (April 9 in 2012) is a holiday:

Properties & Relations  (1)

DayRange with a day type specification other than All is equivalent to a Select statement:

Possible Issues  (2)

A date may only be a holiday if it is not a weekend:

A Sunday is part of the weekend in the Gregorian calendar and therefore cannot be a holiday:

However, a Sunday is not part of the weekend in the Jewish calendar and therefore can be a holiday:

Wolfram Research (2012), DayMatchQ, Wolfram Language function, https://reference.wolfram.com/language/ref/DayMatchQ.html (updated 2014).

Text

Wolfram Research (2012), DayMatchQ, Wolfram Language function, https://reference.wolfram.com/language/ref/DayMatchQ.html (updated 2014).

CMS

Wolfram Language. 2012. "DayMatchQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/DayMatchQ.html.

APA

Wolfram Language. (2012). DayMatchQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DayMatchQ.html

BibTeX

@misc{reference.wolfram_2024_daymatchq, author="Wolfram Research", title="{DayMatchQ}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/DayMatchQ.html}", note=[Accessed: 18-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_daymatchq, organization={Wolfram Research}, title={DayMatchQ}, year={2014}, url={https://reference.wolfram.com/language/ref/DayMatchQ.html}, note=[Accessed: 18-November-2024 ]}