Skip to content

Commit

Permalink
Merge pull request #26 from transloadit/fix/data-formatter
Browse files Browse the repository at this point in the history
Define locale for format of expires string
  • Loading branch information
tjeerdintveen authored Nov 18, 2021
2 parents 705e9b4 + 815e313 commit 90ce1f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Transloadit/Classes/TransloaditExecutor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ class TransloaditExecutor: TUSDelegate {
}

let formatter: DateFormatter = DateFormatter()
formatter.dateFormat = "YYYY/MM/dd HH:mm:s+00:00"
// The locale and time zone are fixed to allow reproducible conversions,
// independent of the locale and time setting on the user's device.
// As recommend in the 'Working With Fixed Format Date Representations' section on
// https://developer.apple.com/documentation/foundation/dateformatter
formatter.locale = Locale(identifier: "en_US_POSIX")
formatter.timeZone = TimeZone(abbreviation: "UTC")
formatter.dateFormat = "YYYY/MM/dd HH:mm:ss+00:00"
let dateTime: String = formatter.string(from: Date().addingTimeInterval(300))
let authObject = ["key": KEY, "expires": dateTime]

Expand Down

0 comments on commit 90ce1f9

Please sign in to comment.