Skip to content

Instantly share code, notes, and snippets.

@atomicbird
Created October 23, 2020 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atomicbird/302d2e815905df409093732992ec91f3 to your computer and use it in GitHub Desktop.
Save atomicbird/302d2e815905df409093732992ec91f3 to your computer and use it in GitHub Desktop.
import UIKit
let dateStr = "625083573.303378"
func date(for dateString: String) -> Date? {
guard let timestamp = Double(dateString) else { return nil }
return Date(timeIntervalSinceReferenceDate: timestamp)
}
date(for: dateStr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment