Convert String to date with timezone persisted swift

I am trying to convert string to date, but timzone (+05:30) is lost everytime. Tried both ways formatter and Calendar.

let formatter : ISO8601DateFormatter = ISO8601DateFormatter() formatter.timeZone = TimeZone.current let dateStr = formatter.string(from: Date()) print(dateStr) if let date = formatter.date(from: dateStr){ print(date) let timestamp = date.timeIntervalSince1970 print(timestamp) }

it prints to:

2018-07-12T12:45:30+05:30 2018-07-12 07:15:30 +0000 1531379730.0

I want to persist the timezone while converting from string to date. Any Help appreciated.Thanks