Date

extension Date
  • Convenience to return date components.

    Declaration

    Swift

    public func components(in timezone: TimeZone = .current,
                           calendar: Calendar = Calendar(identifier: .gregorian)) -> DateComponents

    Parameters

    timezone

    TimeZone used to generate the date components. By default the current timezone is used.

    calendar

    Calendar used to generate the data components. By default the gregorian calendar is used. Currently SwiftIcal can only supports Gregorian calendars.