This repository serves as a playground with kotlinx-datetime
library. Some basic functionalities of the library are
presented through a few tasks/examples.
Tasks:
- Get the current time and print the following:
- Current time in ISO8601 format
- Current time in UNIX timestamp format
- Get the current time and print the following:
- System Time Zone
- Current time adjusted to the time zone:
Europe/Zagreb
- Current time adjusted to the time zone:
America/New_York
- Get the current time and print the following:
- All Local Date Time object attrs
- Parse the given UNIX timestamp and print following:
- Time in ISO8601 format in GMT/UTC+0
- Time in ISO8601 format in UTC+2 or System Time Zone
- Get current UNIX timestamp and print in milliseconds
- Try parse following formats with Instant class:
- "2010-06-01T22:19:44.475Z"
- "1994-11-05T08:15:30-05:00"
- "1994-11-05T08:15:30"
- Try parse following formats with LocalDateTime class
- "2010-06-01T22:19:44.475"
- "2010-06-01T22:19:44.475Z"
- Explore how arithmetic operations works with the Instant class. Calculate time period between:
- "2020-01-01T00:00:00Z"
- Current time + 1 year + 6 months
- Try format the date to date you use daily e.g. 9.6.2022 20:34