Skip to content

Instantly share code, notes, and snippets.

@kunikullaya
kunikullaya / Date+Extension.swift
Created January 18, 2017 05:21
Date Extension for Swift
import Foundation
extension Date {
func toString(format: String = "yyyy-MM-dd") -> String {
let formatter = DateFormatter()
formatter.dateStyle = .short
formatter.dateFormat = format
return formatter.string(from: self)
}

Keybase proof

I hereby claim:

  • I am kunikullaya on github.
  • I am kunikullaya (https://keybase.io/kunikullaya) on keybase.
  • I have a public key whose fingerprint is 69AB B391 CDC4 4211 3076 6A34 C8AB 763B 7B25 8686

To claim this, I am signing this object: