<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/Product/SubscriptionPeriod/dateRange(referenceDate:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "StoreKit"
    ],
    "preciseIdentifier" : "s:8StoreKit7ProductV18SubscriptionPeriodV9dateRange13referenceDateSny10Foundation0I0VGAJ_tF"
  },
  "title" : "dateRange(referenceDate:)"
}
-->

# dateRange(referenceDate:)

The calculated date range of a subscription period, starting at the reference date.

```
@backDeployed(before: iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, macCatalyst 16.0)
func dateRange(referenceDate: Date = .now) -> Range<Date>
```

## Parameters

`referenceDate`

A date you provide that indicates the lower bound of the returned date range. The default value is <doc://com.apple.documentation/documentation/Foundation/Date/now>.

## Return Value

The subscription period represented by two dates that are the lower bound and upper bound of the subscription period of the [`Product.SubscriptionPeriod`](/documentation/StoreKit/Product/SubscriptionPeriod) instance.

## Discussion

The date range calculates a single subscription period starting from the date you provide in `referenceDate`.

For example, if the subscription period of the [`Product.SubscriptionPeriod`](/documentation/StoreKit/Product/SubscriptionPeriod) instance is one month, and the `referenceDate` is February 1, the date range contains February 1 and March 1. If the `referenceDate` is Feb 15, the date range contains February 15 and March 15.

Use the [`dateRange(referenceDate:)`](/documentation/StoreKit/Product/SubscriptionPeriod/dateRange(referenceDate:)) with a <doc://com.apple.documentation/documentation/Foundation/Date/ComponentsFormatStyle> to get a human-readable string representation of the subscription period.

Get the format style (<doc://com.apple.documentation/documentation/Foundation/Date/ComponentsFormatStyle>) corresponding to product’s storefront using the [`subscriptionPeriodFormatStyle`](/documentation/StoreKit/Product/subscriptionPeriodFormatStyle).

---

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)