---
title: "offset(to:allowedFields:maxFieldCount:sign:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/formatstyle/offset(to:allowedfields:maxfieldcount:sign:)"
---

# offset(to:allowedFields:maxFieldCount:sign:)

## Declaration

```swift
static func offset(to anchor: Date, allowedFields: Set<Date.ComponentsFormatStyle.Field> = [.year, .month, .day, .hour, .minute, .second], maxFieldCount: Int = 2, sign: NumberFormatStyleConfiguration.SignDisplayStrategy = .automatic) -> SystemFormatStyle.DateOffset
```
