I am trying to construct a date from a string. The date is in .islamic calendar. I am using the following code
let StringValue = "1439/01/02"
//constructing the Hijri Date
let HijriFormatter = DateFormatter ()
HijriFormatter.calendar = Calendar(identifier: .islamic)
HijriFormatter.dateFormat="yyyy/MM/dd"
HijriFormatter.timeZone = TimeZone(abbreviation: "GMT+0:00")
let hijriDate = HijriFormatter.date(from: StringValue)
print (hijriDate!)
The output should be similar to the string. However, for some reason I am getting the following output:
2017-09-22 00:00:00 +0000
Any idea of why the code is behaving this way