One Logo Pool Ball
Foundation · IOS API REFERENCE

Date.FormatStyle.Symbol.Minute

struct · iOS 15.0+ · SDK 27.1

struct Minute

A type that specifies the format for the minutes in a date format style. The type ``Date/FormatStyle/Symbol/Minute`` includes static factory variables that create custom ``Date/FormatStyle/Symbol/Minute`` objects: |Factory variable|Description| |---|---| | ``defaultDigits`` | The minimum number of digits that represents the numeric minute. For example, `1`, `18`. | | ``twoDigits`` | Two-digit numeric minute, zero-padded if necessary. For example, `01`, `18`. | To customize the minute format in a string representation of a `Date`, use ``Date/FormatStyle/minute(_:)``. The following example shows a variety of ``Date/FormatStyle/Symbol/Minute`` format styles applied to a date. ```swift let meetingDate = Date() // Feb 9, 2021 at 3:05 PM meetingDate.formatted(Date.FormatStyle().minute(.defaultDigits)) // 5 meetingDate.formatted(Date.FormatStyle().minute(.twoDigits)) // 05 meetingDate.formatted(Date.FormatStyle().minute()) // 5 ``` If no format is specified as a parameter, the ``defaultDigits`` static variable is the default format. For more information about formatting dates, see the ``Date/FormatStyle``.

Members (3)

get · iOS 15.0+

defaultDigits

TypeScript
static get defaultDigits(): Date_FormatStyle_Symbol_Minute
Swift declaration
static var defaultDigits: Date.FormatStyle.Symbol.Minute { get }

Minimum digits to show the numeric minute. Truncated, not rounded. For example, `8`, `59`.

get · iOS 18.0+

omitted

TypeScript
static get omitted(): Date_FormatStyle_Symbol_Minute
Swift declaration
static let omitted: Date.FormatStyle.Symbol.Minute

The option for not including the symbol in the formatted output.

get · iOS 15.0+

twoDigits

TypeScript
static get twoDigits(): Date_FormatStyle_Symbol_Minute
Swift declaration
static var twoDigits: Date.FormatStyle.Symbol.Minute { get }

Two-digit numeric, zero padded if needed. For example, `08`, `59`.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →