<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/Product/SubscriptionPeriod/formatted(_:referenceDate:)-8s3ar",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "StoreKit"
    ],
    "preciseIdentifier" : "s:8StoreKit7ProductV18SubscriptionPeriodV9formatted_13referenceDate12FormatOutputQzx_10Foundation0H0VtAJ0I5StyleRzs8DurationV0I5InputRtzlF"
  },
  "title" : "formatted(_:referenceDate:)"
}
-->

# formatted(_:referenceDate:)

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

```
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>.

---

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)