Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let formatter = DateFormatter()
- formatter.dateFormat = "yyyy-MM-dd HH:mm XXX"
- let from = zoneFormatter.date(from: "2018-03-25 00:00 +00:00")!
- let to = zoneFormatter.date(from: "2018-03-26 00:00 +00:00")!
- let components = Calendar.current.dateComponents([.month, .day, .hour, .minute], from: from, to: to)
- // components is 1 day, 1 hour, because I am in UK and Daylight Savings started on 25 March.
Add Comment
Please, Sign In to add comment