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

# secondFraction(_:)

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

## Declaration

```swift
func secondFraction(_ format: Date.FormatStyle.Symbol.SecondFraction) -> Date.FormatStyle
```

## Parameters

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

## Return Value

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

## Discussion

Discussion Static methods that return Date.FormatStyle.Symbol.SecondFraction objects include fractional(_:) and milliseconds(_:). This example shows a variety of Date.FormatStyle.Symbol.SecondFraction format styles applied to a date: let meetingDate = Date() // Feb 9, 2021 at 3:05:41.827 PM meetingDate.formatted(Date.FormatStyle().secondFraction(.fractional(3))) // 827 meetingDate.formatted(Date.FormatStyle().secondFraction(.fractional(1))) // 8 meetingDate.formatted(Date.FormatStyle().secondFraction(.milliseconds(4))) // 11122827 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)
- [second(_:)](foundation/date/formatstyle/second(_:).md)
- [timeZone(_:)](foundation/date/formatstyle/timezone(_:).md)
- [Date.FormatStyle.TimeStyle](foundation/date/formatstyle/timestyle.md)
