<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Calendar/startOfDay(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation8CalendarV10startOfDay3forAA4DateVAG_tF"
  },
  "title" : "startOfDay(for:)"
}
-->

# startOfDay(for:)

Returns the first moment of a given Date, as a Date.

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

## Parameters

`date`

The date to search.

## Return Value

The first moment of the given date.

## Discussion

For example, pass in `Date()`, if you want the start of today. If there were two midnights, it 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)