---
title: "date(byAdding:to:wrappingComponents:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/calendar/date(byadding:to:wrappingcomponents:)"
---

# date(byAdding:to:wrappingComponents:)

Returns a new Date representing the date calculated by adding components to a given date.

## Declaration

```swift
func date(byAdding components: DateComponents, to date: Date, wrappingComponents: Bool = false) -> Date?
```

## Parameters

- `components`: A set of values to add to the date.
- `date`: The starting date.
- `wrappingComponents`: If true, the component should be incremented and wrap around to zero/one on overflow, and should not cause higher components to be incremented. The default value is false.

## Return Value

Return Value A new date, or nil if a date could not be calculated with the given input.

## See Also

### Calculating Dates from Components

- [date(from:)](foundation/calendar/date(from:).md)
- [date(byAdding:value:to:wrappingComponents:)](foundation/calendar/date(byadding:value:to:wrappingcomponents:).md)
- [date(bySetting:value:of:)](foundation/calendar/date(bysetting:value:of:).md)
- [date(bySettingHour:minute:second:of:matchingPolicy:repeatedTimePolicy:direction:)](foundation/calendar/date(bysettinghour:minute:second:of:matchingpolicy:repeatedtimepolicy:direction:).md)
