I didn’t get correct time when using time formatter You have time.text = 02:00 AM and you set your formatter on HH:mm:ss. It’s a wrong formatter, that’s why is null.