Date

public struct Date

A collection of methods that allow formatting Dates as other types, mainly Strings.

Properties

  • The Date that will be used as formatter input.

    Declaration

    Swift

    public let date: Foundation.Date

Initializers

Date String

  • Creates a String representation of date.

    Declaration

    Swift

    func makeString(
        using configurationClosure: (_ dateFormatter: DateFormatter) -> Void
    ) -> String

    Parameters

    configurationClosure

    Required. The block of code that configures DateFormatter before the latter is used for transforming date into a String. Use this opportunity to set date and time style, locale, and more options. See documentation for all properties available to configure.

    dateFormatter

    The DateFormatter that can be configured by the caller.