9 lines · 287 bytes
1 symbol in this file
1use chrono::{DateTime, Datelike};
2
3/// Convert timestamp into `DD/MM/YYYY`
4pub fn date_text(timestamp: u64) -> String {
5 let date = DateTime::from_timestamp(timestamp as i64, 0)
6 .unwrap()
7 .date_naive();
8 format!("{}/{}/{}", date.day(), date.month(), date.year())
9}