Registry / utility / icu-datetime

icu-datetime

JSON →
library2.2.0rscratesunverified

Human-readable formatting of dates, times, and time zones in hundreds of locales.

# Cargo.toml [dependencies] icu_datetime = "2.2.0"
INSTALL
IMPORT
SIG · ICU-DATETIME
I
icu-datetime
utilityrustv2.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DateTimeFormatter
use icu_datetime::DateTimeFormatter;

Format a DateTime using a locale-aware formatter.

use icu_datetime::DateTimeFormatter; use icu_locid::locale; use icu_calendar::DateTime; let dtf = DateTimeFormatter::try_new(&locale!("en-US").into(), Default::default()).unwrap(); let datetime = DateTime::try_new_utc(2023, 10, 5, 14, 30, 0).unwrap(); let formatted = dtf.format(&datetime); println!("{}", formatted);
Debug
Known issues
gotchaRequires ICU4X data provider; may need feature flags or data loading.
fix
Enable the 'compiled_data' feature or provide a DataProvider.
affects: >=2.0.0
Upgrade
Version history
2.2.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
icu-datetime — cargo add icu-datetime · libregistry