---
title: "Aspose::Email::Calendar::Recurrences::ByDay class"
url: "https://reference.aspose.com/email/cpp/aspose.email.calendar.recurrences/byday/"
product: "Aspose.Email for C++"
description: "Represents Nth occurrence (or all occurrences) of the specified day of the week."
---


## ByDay class

Represents Nth occurrence (or all occurrences) of the specified day of the week.

Corresponds to one day of the week specified in the BYDAY part of a recurrence rule.

Can be used in a monthly or yearly recurrence rule to specify Nth occurrence (or all occurrences) of the specified day of the week in a month or year.

BYDAY=MO represents all Mondays of the month or year. To represent all occurrences, set NthOccurrence to 0.

BYDAY=2MO represents 2nd Monday in a month or year.

BYDAY=-1MO represents the last Monday of a month or year.

## Constructors

| Name | Description |
| --- | --- |
| [ByDay (2 overloads)](./byday/) | Initializes a new instance of ByDay class. |

## Methods

| Name | Description |
| --- | --- |
| [Equals](./equals/) | Determines whether the specified Object is equal to the current Object. |
| [Equals_](./equals_/) | Determines whether the specified ByDay is equal to this instance. |
| [get_DayOfWeek](./get_dayofweek/) | Gets the day of the week. |
| [get_IsAllOccurrences](./get_isalloccurrences/) | Returns True when NthOccurrence is zero (meaning all occurrences of this day of week). |
| [get_NthOccurrence](./get_nthoccurrence/) | Gets the nth occurrence of the day of the week. |
| [GetHashCode](./gethashcode/) | GetHashCode returns a hash function for this object. |
| [set_DayOfWeek](./set_dayofweek/) | Sets the day of the week. |
| [set_NthOccurrence](./set_nthoccurrence/) | Sets the nth occurrence of the day of the week. |

