Skip to content

Type Method

minuteSecond(padMinuteToLength:fractionalSecondsLength:roundFractionalSeconds:)

iOS 16.0+ iPadOS 16.0+ Mac Catalyst 16.0+ macOS 13.0+ tvOS 16.0+ watchOS 9.0+
Displays a duration in minutes and seconds with the specified configurations.
static func minuteSecond(padMinuteToLength: Int, fractionalSecondsLength: Int = 0, roundFractionalSeconds: FloatingPointRoundingRule = .toNearestOrEven) -> Duration.TimeFormatStyle.Pattern

Parameters

padMinuteToLength

Padding for the minute field. For example, five minutes is formatted as “05:00” in en_US locale when this value is set to 2.

fractionalSecondsLength

The length of the fractional seconds. For example, one hour is formatted as “1:00:00.00” in en_US locale when this value is set to 2.

roundFractionalSeconds

Rounding rule for the fractional second values.

Return Value

A pattern to format a duration with.