Contents

dateComponents(_:from:to:)

Returns the difference between two dates.

Declaration

func dateComponents(_ components: Set<Calendar.Component>, from start: Date, to end: Date) -> DateComponents

Parameters

  • components:

    Which components to compare.

  • start:

    The starting date.

  • end:

    The ending date.

Return Value

The result of calculating the difference from start to end.

See Also

Extracting Components