Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateFormatter "Date" value with non English locale #136

Open
bendspoons opened this issue Jul 18, 2024 · 0 comments
Open

DateFormatter "Date" value with non English locale #136

bendspoons opened this issue Jul 18, 2024 · 0 comments

Comments

@bendspoons
Copy link

bendspoons commented Jul 18, 2024

Ive stumbled upon a problem where Emails sent couldnt be delivered to certain recipients, especially with IONOS. The problem is a non-conformity with RFC5322 Date and Time Specification.

As my apps used in Germany, the locale is set to de_DE on most devices, which results in the date formatted as e.g. Do., 18 Juli 2024 12:00, where Do is THursday (Donnerstag) in German. I did change it by changing in Mail.swift (as it was time sensitive to solve)

`extension DateFormatter {

static let smtpDateFormatter: DateFormatter = {

    let formatter = DateFormatter()

    **formatter.locale = Locale(identifier: "en_GB")**

    formatter.dateFormat = "EEE, d MMM yyyy HH:mm:ss ZZZ"


    return formatter

}()

}`

Maybe add a param to the init do set a timezone, and use en_GB (or similar) as default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant