It seems that NSDateFormatter
has a \"feature\" that bites you unexpectedly: If you do a simple \"fixed\" format operation such as:
NSDateForma
May I suggest something totally different because to be honest all of this is somewhat running down a rabbit hole.
You should be using one NSDateFormatter
with dateFormat
set and locale
forced to en_US_POSIX
for receiving dates (from servers/APIs).
Then you should be using a different NSDateFormatter
for the UI which you will set the timeStyle
/dateStyle
properties - this way you're not having an explicit dateFormat
set by yourself, thus falsely assuming that format will be used.
This means UI is driven by user preferences (am/pm vs 24 hour, and date strings formatted correctly to user choice - from iOS settings), whereas dates that are "coming into" your app are always being "parsed" correctly to an NSDate
for you to use.