Closed xBINj closed 2 weeks ago
@xBINj
This issue has been resolved in PR #70 (https://github.com/sebastienrousseau/dtt/pull/70) and coming up v0.0.7.
The now()
method has been updated to return a DateTime
instance representing the current date and time, rather than a String or a "Now object". The DateTime
struct now implements the Display
trait, which formats the datetime as an RFC 3339 string when printed, including the date, time, and offset information.
Current behavior:
fn main() {
let v1 = DateTime::new_with_tz("HKT").unwrap().now();
println!("v1: {}", v1);
}
Output: v1: 2024-05-16 19:17:58.8611592 +08:00:00
Many thanks!
dtt version: 0.0.6
in doc description: https://docs.rs/dtt/latest/dtt/struct.DateTime.html now: String Now object: (e.g. “2023-01-01”)
but in running result:
fn main() { let v1 = DateTime::new_with_tz("HKT").unwrap().now; println!("v1: {}", v1); }
it show: Finished
dev
profile [unoptimized + debuginfo] target(s) in 2.36s Runningtarget\debug\dtt01.exe
v1: 2024-05-16 19:17:58.8611592 +08:00:00it include time and offset info.