Created
March 21, 2018 19:03
-
-
Save vialyx/0174f4ae19a7a7a54dc606739020113c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let dateIntervalFormatter = DateIntervalFormatter() | |
dateIntervalFormatter.dateStyle = .medium | |
dateIntervalFormatter.timeStyle = .short | |
let timeIntervalUntilEndDate: TimeInterval = 67490 | |
let startDate = Date() | |
let endDate = startDate.addingTimeInterval(timeIntervalUntilEndDate) | |
let formattedIntervalString = dateIntervalFormatter.string(from: startDate, to: endDate) | |
print("Formatted TimeInterval: \(formattedIntervalString)") | |
// Formatted TimeInterval: Mar 21, 2018, 10:02 PM – Mar 22, 2018, 4:47 PM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment