该文档没有说明有关此主题的任何内容。我需要把它转换成Date<Tz>
? 即使这样,也没有从中获取年份组件的功能。
let current_date = chrono::Utc::now();
let year = current_date.year(); //this is not working, it should output the current year with i32/usize type
let month = current_date.month();
let date = current_date.date();
no method named `month` found for struct `chrono::DateTime<chrono::Utc>` in the current scope