Skip to content

Commit 6a94854

Browse files
authored
containertool: Date.now.ISO8601Format is available on Linux on Swift 6.0 (#32)
### Motivation The convenient `Date.now.ISO8601Format()` method was not present on Linux in earlier versions of Swift, but is available in Swift 6.0. ### Modifications Use `Date.now.ISO8601Format()` instead of creating a separate formatter. ### Result No functional change. ### Test Plan Tests continue to pass.
1 parent 1ee6b17 commit 6a94854

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Sources/containertool/containertool.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ enum AllowHTTP: String, ExpressibleByArgument, CaseIterable { case source, desti
144144

145145
// MARK: Create the application configuration
146146

147-
// The more convenient Date.now.ISO8601Format() is not present on Linux
148-
let formatter = ISO8601DateFormatter()
149-
let now = formatter.string(from: Date.now)
147+
let now = Date.now.ISO8601Format()
150148

151149
// Inherit the configuration of the base image - UID, GID, environment etc -
152150
// and override the entrypoint.

0 commit comments

Comments
 (0)