Experienced the same thing, whenever I change the phone settings to a 24 hour format it spits out nil for some reason.
I tried changing the local to:
dateFormatter.locale = Locale(identifier: "en_US_POSIX") and it worked
Topic:
App & System Services
SubTopic:
General
Tags: