---
title: second()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/date/intervalformatstyle/second()
---

# second()

Modifies the date interval format style to include the seconds.

## Declaration

```swift
func second() -> Date.IntervalFormatStyle
```

## Return Value

Return Value A date interval format style that includes the seconds.

## Discussion

Discussion This example shows a combination of date interval format styles that include the hour, minutes, and seconds: if let today = Calendar.current.date(byAdding: .day, value: -140, to: Date()),    let sevenDaysBeforeToday = Calendar.current.date(byAdding: .day, value: -7, to: today) {

// Create a Range<Date>.     let weekBefore = sevenDaysBeforeToday..<today

print(weekBefore.formatted(.interval.minute()))     print(weekBefore.formatted(.interval.day().minute().hour().second())) } // 2/5/2021, 17 – 2/12/2021, 17 // 5, 8:17:19 AM – 12, 8:17:19 AM

## See Also

### Modifying Date Interval Format Styles

- [day()](foundation/date/intervalformatstyle/day().md)
- [hour(_:)](foundation/date/intervalformatstyle/hour(_:).md)
- [minute()](foundation/date/intervalformatstyle/minute().md)
- [month(_:)](foundation/date/intervalformatstyle/month(_:).md)
- [weekday(_:)](foundation/date/intervalformatstyle/weekday(_:).md)
- [year()](foundation/date/intervalformatstyle/year().md)
