About date-time-formatter
'date-time-formatter' is a Rust crate that provides a simple and efficient way to parse and format date and time values. It is a rewrite of a subset of the Java time library, and aims to match its behaviour.
This ports DateTimeFormatterBuilder 1:1 from Java into Rust, with the following simplifying assumptions:
- ResolverStyle is set to SMART
- CaseSensitivity is set to false
- Locale is always assumed to be U.S.
- We only support the default Gregorian Chronology
Additionally, this provides logic for converting from the Parsed representation into a Chrono (Naive)DateTime, and back. The resolution from Parsed into Chrono aims to replicate the results of Java equivalents, but is not 1:1 port.
Example usage
let parsing_formatter = of_pattern?;
let printing_formatter = of_pattern?;
let original_string = "2025-05-13T14:30:00";
let parsed: Parsed = parsing_formatter.parse?;
let recovered_string = printing_formatter.format?;
assert_eq!;
Contact
Created by Shiv Bhatia