# kotlin/kotlinx-datetime

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/kotlin-kotlinx-datetime).**

2,775 stars · 131 forks · Kotlin · apache-2.0

## Links

- GitHub: https://github.com/Kotlin/kotlinx-datetime
- awesome-repositories: https://awesome-repositories.com/repository/kotlin-kotlinx-datetime.md

## Topics

`date` `datetime` `kotlin` `timezone`

## Description

kotlinx-datetime is a multiplatform library for handling date, time, and calendar operations across different targets. It provides a consistent set of data types for representing instants and local date-times, serving as a standardized API for temporal management.

The toolkit focuses on ISO 8601 compliance for parsing and formatting date and time strings. It implements a multiplatform approach to ensure that timestamps and calendar logic remain consistent across all supported platforms.

The library covers temporal data modeling, calendar arithmetic for calculating durations and periods, and regional time zone transformations to convert absolute timestamps into human-readable local times. It also includes utilities for Unicode pattern formatting and the normalization of irregular date components.

## Tags

### Data & Databases

- [Date and Time Libraries](https://awesome-repositories.com/f/data-databases/date-and-time-libraries.md) — Provides a standardized multiplatform API for handling date, time, and calendar operations.
- [Temporal Type Specifications](https://awesome-repositories.com/f/data-databases/data-type-definitions/temporal-type-specifications.md) — Implements a set of consistent data types to represent timestamps, local times, and calendar dates. ([source](https://github.com/Kotlin/kotlinx-datetime#readme))
- [Time Zone Management](https://awesome-repositories.com/f/data-databases/time-zone-management.md) — Transforms absolute timestamps into human-readable components using regional time zone rules and databases. ([source](https://github.com/Kotlin/kotlinx-datetime/blob/master/README.md))
- [Time Zone Conversions](https://awesome-repositories.com/f/data-databases/time-zone-management/time-zone-conversions.md) — Transforms absolute timestamps into human-readable local date-time components based on regional time zone rules.
- [Immutable Date Processing](https://awesome-repositories.com/f/data-databases/immutable-date-processing.md) — Uses immutable data classes for time points and periods to prevent side effects during calculations.

### Programming Languages & Runtimes

- [Multiplatform Date Time APIs](https://awesome-repositories.com/f/programming-languages-runtimes/multiplatform-date-time-apis.md) — Provides a consistent multiplatform API for representing and manipulating instants and local date-times. ([source](https://github.com/Kotlin/kotlinx-datetime/blob/master/.gitattributes))
- [Time Zone Converters](https://awesome-repositories.com/f/programming-languages-runtimes/programming-utilities/date-and-time-utilities/time-zone-converters.md) — Converts high-resolution timestamps into readable date and time components based on a specified time zone. ([source](https://github.com/Kotlin/kotlinx-datetime#readme))

### Development Tools & Productivity

- [Ambiguity-Free Type Modeling](https://awesome-repositories.com/f/development-tools-productivity/date-and-time-utilities/calendar-date-calculations/ambiguity-free-type-modeling.md) — Eliminates ambiguity by using distinct types for instants, local date-times, and year-month combinations. ([source](https://github.com/Kotlin/kotlinx-datetime/blob/master/README.md))
- [Calendar Date Calculations](https://awesome-repositories.com/f/development-tools-productivity/date-and-time-utilities/calendar-date-calculations.md) — Performs date arithmetic to determine durations between timestamps using calendar-aware units.
- [Date Period Arithmetic](https://awesome-repositories.com/f/development-tools-productivity/date-and-time-utilities/component-based-date-time-specifications/date-period-arithmetic.md) — Calculates new dates and durations using date-based units and temporal periods. ([source](https://github.com/Kotlin/kotlinx-datetime/blob/master/README.md))
- [Duration Calculations](https://awesome-repositories.com/f/development-tools-productivity/date-and-time-utilities/duration-calculations.md) — Calculates durations between timestamps using calendar-aware units such as years and months. ([source](https://github.com/Kotlin/kotlinx-datetime#readme))
- [Date String Formatters](https://awesome-repositories.com/f/development-tools-productivity/date-formatting-utilities/date-string-formatters.md) — Converts temporal objects to strings and vice versa using Unicode pattern strings. ([source](https://github.com/Kotlin/kotlinx-datetime#readme))
- [Duration Arithmetic Operations](https://awesome-repositories.com/f/development-tools-productivity/duration-formatters/duration-interval-calculators/duration-arithmetic-operations.md) — Provides arithmetic operations for adding and subtracting time durations with precise overflow rules.

### Software Engineering & Architecture

- [Multiplatform Code Sharing](https://awesome-repositories.com/f/software-engineering-architecture/cross-platform-development/multiplatform-code-sharing.md) — Uses a shared API module with platform-specific native implementations to ensure consistent date-time logic across targets.
- [ISO 8601 Standards](https://awesome-repositories.com/f/software-engineering-architecture/data-exchange-standards/iso-8601-standards.md) — Implements parsing and formatting logic strictly adhering to the ISO 8601 international standard.

### Scientific & Mathematical Computing

- [Calendar Arithmetic](https://awesome-repositories.com/f/scientific-mathematical-computing/calendar-arithmetic.md) — Includes a set of tools for performing date mathematics and calculating durations using years and months.
