5

From the debugger it shows that the date string is "2017-08-01 00:00:00" and I passed the correct format too. But the dateFormatter.date part always fail (return nil) for 1 device. But some its working for simulator and other iphone devices. Im using swift3

enter image description here

iPhone 7 that fails

Abhishek Jain
  • 4,557
  • 2
  • 32
  • 31
iadcialim24
  • 3,817
  • 5
  • 21
  • 32

1 Answers1

10

Try to set your locale:

dateFormatter.locale = Locale(identifier: "en_US_POSIX")
Ayman Ibrahim
  • 1,359
  • 15
  • 24