chrono-unit
A date-time formatter and time-unit library for Rust time
1.Items
1.1.Structs
1.2.Enums
1.3.Traits
2.Usage
2.1.TimeUnit
2.1.1.functions
-
to_nanos-
Nanoseconds.to_nanos
-
-
to_micros -
to_millis -
to_seconds -
to_minutes -
to_hours -
to_days -
value-
value_of
-
2.2.Formatter
2.2.1.Builtin
let dtf = builtin;
// default pattern: DateTimePattern::YyyyMmDdHhMmSs
2.2.2.new
let dtf = new;
2.2.3.of_pattern
let dtf = new;
let dtf = dtf.of_pattern;
2.2.4.Format
2.2.4.1.format_date_time_utc_default
DateTime<Utc>- Default pattern
let now = "2024-03-01 02:03:04";
let ndt = parse_from_str.expect;
let datetime_utc: = Utc.from_utc_datetime;
let dtf = new;
assert_eq!;
2.2.4.2.format_date_time_utc
let now = "2024-03-01 02:03:04";
let ndt = parse_from_str.expect;
let datetime_utc: = Utc.from_utc_datetime;
let dtf = new;
assert_eq!;
2.2.4.3.format_naive_date_time_utc_default
with timezone
let now = "2024-03-01 02:03:04";
let ndt = parse_from_str.expect;
let dtf = new;
assert_eq!;
2.2.4.4.format_naive_date_time_utc
with timezone
let now = "2024-03-01 02:03:04";
let ndt = parse_from_str.expect;
let dtf = new;
assert_eq!;
2.2.4.5.format_naive_date_time_default
let now = "2024-03-01 02:03:04";
let ndt = parse_from_str.expect;
let dtf = new;
assert_eq!;
2.2.4.6.format_naive_date_time
let now = "2024-03-01 02:03:04";
let ndt = parse_from_str.expect;
let dtf = new;
assert_eq!;