- A
Dateis a point in time, it doesn’t have a format nor a time zone. printshows the description – a string representation – of the date in the UTC time zone.- Your time zone is obviously UTC +0900,
2020-04-12 00:00:00 +0900and2020-04-11 15:00:00 +0000is the same point in time. -
If you want to create the date string independent of the time zone add the line
dateFormatIn.timeZone = TimeZone(secondsFromGMT: 0)
5
solved how to convert a String to a Date without changing the Format