<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSCalendar/startOfDay(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCalendar(im)startOfDayForDate:"
  },
  "title" : "startOfDay(for:)"
}
-->

# startOfDay(for:)

Returns the first moment of a given date as a date instance.

```
func startOfDay(for date: Date) -> Date
```

## Parameters

`date`

The date for which to perform the calculation.

## Return Value

An `NSDate` instance representing the first moment date of the given date.

## Discussion

For example, passing `[NSDate date]` for the `date` parameter would give you the start of “today.”

### Special Considerations

If there were two midnights, this method returns the first. If there was none, it returns the first moment that did exist.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)