Open
Description
Previous ID | SR-14793 |
Radar | rdar://FB9198760 |
Original Reporter | @subdigital |
Type | Improvement |
Additional Detail from JIRA
Votes | 7 |
Component/s | Foundation |
Labels | Improvement |
Assignee | None |
Priority | Medium |
md5: 5aed7eda3fe782930b44c5d2635950e5
Issue Description:
Using the new formatted() API, the `.iso8601` style produces a separator-less representation. I've personally never seen this in the wild and was surprised by it.
Adding the dash and colon separators for the more common format is quite verbose.
import Foundation
let date = Date()
date.formatted(.iso8601) // "20210618T191800Z"
date.formatted(.iso8601.year().month().day().dateSeparator(.dash)) // "2021-06-18"
date.formatted(.iso8601.dateSeparator(.dash).timeSeparator(.colon)) // "2021-06-18T19:18:00Z"
Would it be possible to change this to have a `.separatorStyle(.none)` option instead and keep dash/colon separators as the default?
Inspired by: