Member-only story
Swift’s JSONDecoder’s ONE BIG MISS
Handle TimeStamps from your Backend in Your Swift Application
5 min readMar 23, 2021
Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.4, and Swift 5.3.2
This article has a supporting video at: YouTube video
Prerequisites
- You just need to be able to create a Swift project, but it might help you to read over the Date and Time Cheatsheet
The background
You will almost certainly need to communicate with a backend through a published API. In fact, you might use an API like the Twitter API that is stable and well documented.
Now depending on why you are using an API, you might well have a date/time returned to you.
Here is a snippet of data from a cursor-based API
2020–06–24T17:19:07.000Z ??
Yet this isn’t the only format that dates can be. This article covers both the ISO…