You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been exploring the time package and have found it to be a robust solution for handling dates and times. However, I've noticed that there doesn't seem to be a direct way to convert between the package's types and Swift's standard Date type.
Given that interoperability with existing codebases and libraries often requires working with Date, I was wondering about the rationale behind this design decision.
Some example syntax:
import Foundation
import Testing
import Date
@Test
func test(){
let systemClock = Clocks.system
let threeMonthsFromNow = systemClock.currentDay + .months(3)
let date: Date = .init(threeMonthsFromNow)
print(date)
}
I understand that the package's types offer more precision and correctness, especially when dealing with different calendars and time zones. However, I'm curious about how to best bridge the gap when working in a mixed environment.
Thank you for your time and for creating this valuable package. I look forward to understanding more about this aspect of the library's design.
The text was updated successfully, but these errors were encountered:
coenttb
changed the title
Conversion between Instant and Swift.Date
Conversion between Time and Swift.Date
Sep 5, 2024
I've been exploring the time package and have found it to be a robust solution for handling dates and times. However, I've noticed that there doesn't seem to be a direct way to convert between the package's types and Swift's standard Date type.
Given that interoperability with existing codebases and libraries often requires working with Date, I was wondering about the rationale behind this design decision.
Some example syntax:
I understand that the package's types offer more precision and correctness, especially when dealing with different calendars and time zones. However, I'm curious about how to best bridge the gap when working in a mixed environment.
Thank you for your time and for creating this valuable package. I look forward to understanding more about this aspect of the library's design.
The text was updated successfully, but these errors were encountered: