Advertisement
Cabaca

Untitled

Aug 14th, 2024
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.27 KB | None | 0 0
  1. extension Kotlinx_datetimeLocalDate {
  2.  
  3.     func toDate() -> Date? {
  4.  
  5.         let components = DateComponents(year: Int(self.year), month: Int(self.month.ordinal+1), day: Int(self.dayOfMonth))
  6.  
  7.         return Calendar.current.date(from: components)
  8.  
  9.     }
  10.  
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement