Skip to content

Commit

Permalink
Set dateFormatter locale in non-async code as well
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Oct 24, 2023
1 parent 3065df3 commit e661327
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public extension CognitoAuthenticatable {
// cognito expects the dateformat to have the timezone as UTC
dateFormatter.dateFormat = "EEE MMM d HH:mm:ss 'UTC' yyyy"
dateFormatter.timeZone = TimeZone(identifier: "UTC")
// cognito expects the dateformat to be in English
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
let timestamp = dateFormatter.string(from: Date())

// construct claim
Expand Down

0 comments on commit e661327

Please sign in to comment.