Kitura / Kitura/Swift-SMTP

DateFormatter "Date" value with non English locale

Open
#136 0 comments 0 reactions 1 assignee Claimed by @adam-rocska View on GitHub
Dominant language
Swift
Stars
290
Forks
68
PR merge metrics
No merged PRs in 30d

Description

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](https://datatracker.ietf.org/doc/html/rfc5322#section-3.3).

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.