Contents

zeroFormattingBehavior

The formatting style for units whose value is 0.

Declaration

var zeroFormattingBehavior: DateComponentsFormatter.ZeroFormattingBehavior { get set }

Discussion

When the value for a particular unit is 0, the zero formatting behavior determines whether that value is retained or omitted from any resulting strings. For example, when the formatting behavior is dropTrailing, the value of one hour, ten minutes, and zero seconds would omit the mention of seconds.

The default value of this property is default.

See Also

Configuring the Formatter Options