DatabaseDateComponents

public struct DatabaseDateComponents : DatabaseValueConvertible

DatabaseDateComponents reads and stores DateComponents in the database.

  • The available formats for reading and storing date components.

    See more

    Declaration

    Swift

    public enum Format : String
  • The date components

    Declaration

    Swift

    public let dateComponents: DateComponents
  • The database format

    Declaration

    Swift

    public let format: Format
  • Creates a DatabaseDateComponents from a DateComponents and a format.

    The result is nil if and only if dateComponents is nil.

    Declaration

    Swift

    public init?(_ dateComponents: DateComponents?, format: Format)

    Parameters

    dateComponents

    An optional DateComponents.

    format

    The format used for storing the date components in the database.

    Return Value

    An optional DatabaseDateComponents.