DBDate

DigitalblendKit provides Date Sub Component to manage ISO Date Formatting.

Instalation

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but Alamofire does support its use on supported platforms.

Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "http://git.digitalblend.lan/Framework/DigitalblendKit-swift.git")
]

Usage

Import

import Digitalblend

Format

First you need to retrive the formatter.

DBDate.formatter

Now you can work with dates.


// Date to String
let date = Date()
let string = DBDate.formatter.string(from: date)

// String to Date
let string = "2019-10-18T06:44:53Z"
let date = DBDate.formatter.date(from: string) // date: Date? (can be nil)

Todo

  • [ ]