Cargo Features

chrono = { version = "0.4.31", default-features = false, features = ["std", "alloc", "libc", "winapi", "clock", "oldtime", "wasmbind", "unstable-locales", "rustc-serialize", "serde", "rkyv", "arbitrary"] }
default = clock, oldtime, std, wasmbind

These default features are set whenever chrono is added without default-features = false somewhere in the dependency tree.

std default clock

Affects formatting::DelayedFormat, formatting::format, formatting::format_item

alloc unstable-locales?

Affects formatting::DelayedFormat, formatting::format, formatting::format_item

winapi clock = windows-targets
clock default = android-tzdata, iana-time-zone, std, winapi
oldtime default
wasmbind default = js-sys, wasm-bindgen
unstable-locales = alloc, pure-rust-locales

Affects formatting::format_localized, formatting::format_item_localized

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

rustc-serialize implicit feature
serde implicit feature

Affects chrono::serde, naive::serde

pure-rust-locales unstable-locales?
rkyv implicit feature

With default features

android-tzdata cfg(target_os = "android") clock
iana-time-zone cfg(unix) clock

With fallback

js-sys cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi")))) wasmbind
wasm-bindgen cfg(all(target_arch = "wasm32", not(any(target_os = "emscripten", target_os = "wasi")))) wasmbind

With default features

windows-targets cfg(windows) winapi?

Enables windows-targets ^0.48

arbitrary implicit feature

With derive