Releases: rbatis/fastdate
Releases · rbatis/fastdate
v0.3.22
v0.3.21
v0.3.19
v0.3.19
- add
format(fmt:&str)
method
format support token = ["YYYY","MM","DD","hh","mm","ss",".000000","+00:00"]
let dt = fastdate::DateTime::from((
fastdate::Date {
day: 1,
mon: 1,
year: 2000,
},
fastdate::Time {
nano: 123456000,
sec: 11,
minute: 1,
hour: 1,
})).set_offset(8 * 60 * 60);
println!("{}",dt.format("YYYY/MM/DD/hh/mm/ss/.000000/+00:00"));
println!("{}",dt.format("YYYY-MM-DD/hh/mm/ss"));
- add
pub fn offset_hms(&self) -> (i8, i8, i8);
v0.3.17
v0.3.17
- parse an string by format.
- format support token = ["YYYY","MM","DD","hh","mm","ss",".000000","+00:00"]
- format str must be example:
or time zone(UTC+Hour)
fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000+00:00", "2022-12-13 11:12:14.123456+06:00").unwrap();
fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000+00:00", "2022-12-13 11:12:14.123456-03:00").unwrap();
or time zone(UTC)
fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000Z", "2022-12-13 11:12:14.123456Z").unwrap();
parse local time
fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000","2022-12-13 11:12:14.123456").unwrap();
or any position
fastdate::DateTime::parse("YYYY-MM-DD,hh:mm:ss.000000","2022-12-13,11:12:14.123456").unwrap();
or time zone(UTC)
fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000", "2022-12-13 11:12:14.123456Z").unwrap();
or time zone(UTC+Hour)
fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000", "2022-12-13 11:12:14.123456+06:00").unwrap();
v0.3.16
v0.3.15
v0.3.14
v0.3.14
- support parse zone
/// parse local time
fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000","2022-12-13 11:12:14.123456").unwrap();
///or any position
fastdate::DateTime::parse("YYYY-MM-DD,hh:mm:ss.000000","2022-12-13,11:12:14.123456").unwrap();
/// or time zone(UTC)
fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000", "2022-12-13 11:12:14.123456Z").unwrap();
/// or time zone(UTC+Hour)
fastdate::DateTime::parse("YYYY-MM-DD hh:mm:ss.000000", "2022-12-13 11:12:14.123456+06:00").unwrap();