From the course: Kotlin Multiplatform Development

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

Dates in Kotlinx-datetime

Dates in Kotlinx-datetime

- [Instructor] Dates are hard. There's a joke that engineers, much like Microsoft Excel, both struggle to know when something is a date, but also the very nature of dates and times is unbelievably complex. Most regular people don't understand this, but there are so many examples. To get an idea, I recommend Googling, "Falsehoods engineers believe about time." Once you get basic date handling working, you then start to deal with time zones, and then fractional time zones, and once time zones seem all right, you then have to deal with daylight savings time, even sometimes fractional daylight savings time within the same time zone. Once you've got your time working right, you'll be very lucky if you never have to deal with historical times or dates before the laws change what the times and dates mean. The point of this is all very simple. Never ever roll your own date and time handling logic, unless you absolutely have to. It's foolish and is only ever going to make you very, very sad…

Contents