Decode ISO 8601 API Dates with JSONDecoder in Swift
Set JSONDecoder.dateDecodingStrategy to .iso8601 so Swift decodes API date strings directly into Date values.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Set JSONDecoder.dateDecodingStrategy to .iso8601 so Swift decodes API date strings directly into Date values.
Learn how to set up a single JSONDecoder that converts snake_case keys to camelCase properties and parses ISO 8601 timestamps with fractional seconds, plus the pitfalls to watch for.
Markdown's CommonMark specification does not define any syntax for dates, times, or timezone offsets, leaving timestamp handling entirely to surrounding tools. Static-site generators such as Jekyll and Hugo parse ISO‑8601 strings in front matter, while general-purpose renderers like pandoc and markdown‑it typically pass date literals through unchanged. This
Goal: store a timestamp attribute that supports correct chronological ordering for range queries and enables prefix‑based filters when used as a DynamoDB sort key. Constraint: the attribute must be stored in a single canonical format because mixing UTC ISO 8601 strings, offset‑containing strings, or epoch numbers breaks lexicographic or numeric sort order an