---
title: SystemFormatStyle
framework: swiftui
role: symbol
role_heading: Enumeration
path: swiftui/systemformatstyle
---

# SystemFormatStyle

A collection of format styles for displaying live-updating time information in Text views.

## Declaration

```swift
enum SystemFormatStyle
```

## Overview

Overview Use the format styles in this namespace to present time-based data that automatically updates as the system clock advances. Each style formats a Date value into an AttributedString and conforms to both FormatStyle and DiscreteFormatStyle, allowing SwiftUI to efficiently schedule text updates at exactly the right moments. You typically use these styles with the Text/init(_:format:)-2rl92 initializer: let startDate = Date.now let endDate = startDate.addingTimeInterval(300)

Text(.currentDate, format: .offset(to: startDate)) // Output: "3 minutes, 42 seconds"

Text(.currentDate, format: .stopwatch(startingAt: startDate)) // Output: "00:03.42"

Text(.currentDate, format: .timer(countingDownIn: startDate..<endDate)) // Output: "4:17"

Text(.currentDate, format: .reference(to: endDate)) // Output: "in 5 minutes" Choosing a Style  |  |   |  |   |  |   |  |   |  |

## Topics

### Structures

- [SystemFormatStyle.DateOffset](swiftui/systemformatstyle/dateoffset.md)
- [SystemFormatStyle.DateReference](swiftui/systemformatstyle/datereference.md)
- [SystemFormatStyle.Stopwatch](swiftui/systemformatstyle/stopwatch.md)
- [SystemFormatStyle.Timer](swiftui/systemformatstyle/timer.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Formatting date and time

- [TimeDataSource](swiftui/timedatasource.md)
