Igor Dudenkov
01/22/2025, 4:15 PMNSDate(timeIntervalSince1970: ...)
initializer in Kotlin to create a date object from a timestamp in seconds?
I'm working on iOS-specific code to return a formatted date string given a timestamp, but the available initializers seem limited.
Specifically, I can only use NSDate(timeIntervalSinceReferenceDate: ...)
or NSDate()
. However, I need to work with NSDate(timeIntervalSinceReferenceDate: ...)
for my implementation.
What do you typically use to format dates across iOS and Android?Alexandru Caraus
01/22/2025, 7:02 PMJulian Pellico
02/12/2025, 10:40 PMJulian Pellico
02/12/2025, 10:45 PMtoNSDateComponents()
, got an NSDate from that, and passed that to stringFromDate
of an NSDateFormatter. This was in an expect/actual function.