In this thread: https://developer.apple.com/forums/thread/650535 an Apple Developer Tools Engineer wrote:
66
You can use SwiftUI's new Text initializer to display the relative time to a certain timestamp. For more information you can checkout: https://developer.apple.com/documentation/swiftui/text/init(_:style:)
This Text view updates automatically without you needing to provide new entries for every second.
99
This does work, but there's no way of formatting the result, so a date 24 days 8 hours into the future shows as "584:00:00" and counts down like "583:59:59", "583:59:58" etc.
I'd like it to say something like "24 days, 08:00:00". Is there any way of doing that?
66
You can use SwiftUI's new Text initializer to display the relative time to a certain timestamp. For more information you can checkout: https://developer.apple.com/documentation/swiftui/text/init(_:style:)
This Text view updates automatically without you needing to provide new entries for every second.
99
This does work, but there's no way of formatting the result, so a date 24 days 8 hours into the future shows as "584:00:00" and counts down like "583:59:59", "583:59:58" etc.
I'd like it to say something like "24 days, 08:00:00". Is there any way of doing that?