---
title: "isDate(_:inSameDayAs:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/calendar/isdate(_:insamedayas:)"
---

# isDate(_:inSameDayAs:)

Returns a Boolean value indicating whether a date is within the same day as another date.

## Declaration

```swift
func isDate(_ date1: Date, inSameDayAs date2: Date) -> Bool
```

## Parameters

- `date1`: A date to check for containment.
- `date2`: A date to check for containment.

## Return Value

Return Value true if date1 and date2 are in the same day, as defined by the calendar and calendar’s locale; otherwise, false.

## See Also

### Comparing Dates

- [compare(_:to:toGranularity:)](foundation/calendar/compare(_:to:togranularity:).md)
- [isDate(_:equalTo:toGranularity:)](foundation/calendar/isdate(_:equalto:togranularity:).md)
- [isDateInToday(_:)](foundation/calendar/isdateintoday(_:).md)
- [isDateInTomorrow(_:)](foundation/calendar/isdateintomorrow(_:).md)
- [isDateInYesterday(_:)](foundation/calendar/isdateinyesterday(_:).md)
- [isDateInWeekend(_:)](foundation/calendar/isdateinweekend(_:).md)
