DayMatchQ
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} January 1 of the year y "string" date as a string ("Jan. 1, 2000") {y,m,d,h,m,s} precise time time absolute time specification - Possible day types are:
-
All any calendar date (default) "Weekday" date considered a weekday "Weekend" date considered a weekend "Holiday" holiday according to HolidayCalendar "NonHoliday" date that is not a holiday "BusinessDay" non-holiday weekday "NonBusinessDay" holiday or weekend "WeekdayHoliday" holiday on a weekday "WeekendHoliday" holiday on a weekend "WeekendNonHoliday" non-holiday weekend Monday, Tuesday, … a specific day of the week "EndOfMonth" final day of a given month "BeginningOfMonth" first day of a given month - In the Jewish and Islamic calendars, the weekdays are Sunday through Thursday.
- DayMatchQ takes the following options:
-
CalendarType Automatic calendar in which the date has been specified HolidayCalendar {"UnitedStates","Default"} holiday schedule and subspecification for the business day and holiday computations
Examples
open all close allBasic Examples (5)
Find out if today is a weekend day:
DayMatchQ[Today, "Weekend"]Find out if today is a business day:
DayMatchQ[Today, "BusinessDay"]Find out if today is a non-weekend holiday:
DayMatchQ[Yesterday, "Holiday"]Find out if July 4 is a holiday in Brazil:
DayMatchQ[DateObject[{2022, 7, 4}, "Day", "Gregorian", -6.], "Holiday", HolidayCalendar -> "Brazil"]Find out if July 4 is a holiday in the US:
DayMatchQ[DateObject[{2022, 7, 4}, "Day"], "Holiday", HolidayCalendar -> "UnitedStates"]Scope (3)
Input the date in string form:
DayMatchQ["aug. 4, 1980", "Holiday"]What fraction of the time non-weekend holidays occur on Mondays:
Length[Select[DayRange[{2000}, {2050}, "Holiday"], DayMatchQ[#, Monday]&]] / DayCount[{2000}, {2050}, "Holiday"]//NUse the operator form to test for a specific day type:
DayMatchQ[Wednesday][DateObject[{2025, 4, 23}, "Day"]]DayMatchQ["WeekendHoliday"][DateObject[{2025, 1, 1}, "Day"]]Options (3)
CalendarType (1)
HolidayCalendar (2)
The holiday calendar determines which days qualify as "Holiday":
DayMatchQ[{2026, 4, 6}, "Holiday"]DayMatchQ[{2026, 4, 6}, "Holiday", HolidayCalendar -> "HongKong"]Different markets within a country may have different holiday schedules:
CalendarData["UnitedStates"]DayMatchQ[DateObject[{2022, 4, 15}], "Holiday", CalendarType -> "Gregorian", HolidayCalendar -> {"UnitedStates", "NYSE"}]DayMatchQ[DateObject[{2022, 4, 15}], "Holiday", CalendarType -> "Gregorian", HolidayCalendar -> "UnitedStates"]Applications (1)
Properties & Relations (2)
DayRange with a day type specification other than All is equivalent to a Select statement:
DayRange[{2022}, {2023}, "Weekend"] === Select[DayRange[{2022}, {2023}], DayMatchQ[#, "Weekend"]&]DayMatchQ[date,"BusinessDay"] is equivalent to BusinessDayQ[date]:
DayMatchQ[Today, "BusinessDay"]BusinessDayQ[Today]Possible Issues (2)
A date may only be a holiday if it is not a weekend:
DayMatchQ[{2022, 7, 30}, "Weekend"]DayMatchQ[{2022, 7, 30}, "Holiday", HolidayCalendar -> {"Gregorian" -> {{True&, # == 7&, # == 30&}}}]A Sunday is part of the weekend in the Gregorian calendar and therefore cannot be a holiday:
sundayGregorian = DateObject[{2022, 7, 31}]DayMatchQ[sundayGregorian, "Holiday", HolidayCalendar -> {"Gregorian" -> {{True&, # == 7&, # == 31&}}}]However, a Sunday is not part of the weekend in the Jewish calendar and therefore can be a holiday:
sundayJewish = CalendarConvert[sundayGregorian, "Jewish"]DayMatchQ[sundayJewish, "Holiday", HolidayCalendar -> {"Gregorian" -> {{True&, # == 7&, # == 31&}}}]Related Guides
Text
Wolfram Research (2012), DayMatchQ, Wolfram Language function, https://reference.wolfram.com/language/ref/DayMatchQ.html (updated 2025).
CMS
Wolfram Language. 2012. "DayMatchQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. 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_2026_daymatchq, author="Wolfram Research", title="{DayMatchQ}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/DayMatchQ.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_daymatchq, organization={Wolfram Research}, title={DayMatchQ}, year={2025}, url={https://reference.wolfram.com/language/ref/DayMatchQ.html}, note=[Accessed: 13-June-2026]}