---
title: "formatted(_:referenceDate:)"
framework: storekit
role: symbol
role_heading: Instance Method
path: "storekit/product/subscriptionperiod/formatted(_:referencedate:)-8s3ar"
---

# formatted(_:referenceDate:)

Formats the subscription period using a format style that takes a duration as an input.

## Declaration

```swift
func formatted<S>(_ format: S, referenceDate: Date = .now) -> S.FormatOutput where S : FormatStyle, S.FormatInput == Duration
```

## Parameters

- `format`: A format style that has a duration as an input.
- `referenceDate`: The starting date of the subscription period. The default value is doc://com.apple.documentation/documentation/Foundation/Date/now.

## See Also

### Formatting the subscription period

- [formatted(_:referenceDate:)](storekit/product/subscriptionperiod/formatted(_:referencedate:)-3t7wd.md)
