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

# isDate(_:inSameDayAs:)

Indicates whether two dates are in the same day.

## Declaration

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

## Parameters

- `date1`: The first date to compare.
- `date2`: The second date to compare.

## Return Value

Return Value true if both dates are within the same day, otherwise false.

## See Also

### Comparing Dates

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