I am aware about similar questions, however, I couldn't find this exact one:
In an iOS application, I am receiving a date in the format dd-MM-yyyy HH:mm:ss (i.e. 30-07-2019 12:05:00) in GMT +2h, and I like to convert it to yyyy-MM-dd HH:mm:ss +0000 in GMT ±0h (i.e. 2019-07-30 10:05:00 +0000).
How can I do this?
Firstly create 2 DateFormatter. First dateFormat for create date from dateString. Second dateFormat for create string from created date.
Code:
Result: