Skip to content

Instantly share code, notes, and snippets.

View nizzam's full-sized avatar
🎼
★ :. . • ○ ° ★° ☾ ☆ ¸. ¸ 

Nizzam nizzam

🎼
★ :. . • ○ ° ★° ☾ ☆ ¸. ¸ 
  • Kuala Lumpur, Malaysia
View GitHub Profile
let df = DateFormatter()
df.dateFormat = "yyyy-MM-dd"
df.timeZone = .current
let df2 = DateFormatter()
df2.dateFormat = "yyyy-MM-dd HH:mm:ss"
let stringDate = "2019-09-28"
let customDate = df.date(from: stringDate)