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

# second(_:)

Modifies the date format style to use the specified second format style.

## Declaration

```swift
func second(_ format: Date.FormatStyle.Symbol.Second = .defaultDigits) -> Date.FormatStyle
```

## Parameters

- `format`: The second format style applied to the date format style.

## Return Value

Return Value A date format style modified to include the specified second style.

## Discussion

Discussion Values of Date.FormatStyle.Symbol.Second are defaultDigits and twoDigits. This example shows a variety of Date.FormatStyle.Symbol.Second format styles applied to a date: let meetingDate = Date() // Feb 9, 2021 at 3:05 PM meetingDate.formatted(Date.FormatStyle().second(.defaultDigits)) // 5 meetingDate.formatted(Date.FormatStyle().second(.twoDigits)) // 05 meetingDate.formatted(Date.FormatStyle().second()) // 5 If you don’t provide a format, the defaultDigits static variable is the default format. For more information about formatting dates, see Date.FormatStyle.

## See Also

### Specifying the Time Format

- [hour(_:)](foundation/date/formatstyle/hour(_:).md)
- [minute(_:)](foundation/date/formatstyle/minute(_:).md)
- [secondFraction(_:)](foundation/date/formatstyle/secondfraction(_:).md)
- [timeZone(_:)](foundation/date/formatstyle/timezone(_:).md)
- [Date.FormatStyle.TimeStyle](foundation/date/formatstyle/timestyle.md)
