INNER CODE UNIT · Rust

created_as_string

szabodanika/microbin · src/pasta.rs:136

    pub fn created_as_string(&self) -> String {
        Local.timestamp_opt(self.created, 0).map(|date| {
            format!(
                "{:02}-{:02} {:02}:{:02}",
                date.month(),
                date.day(),
                date.hour(),
                date.minute(),
            )
        }).earliest().unwrap_or_else(|| {
            log::error!("Failed to process created date");
            String::from("Unknow")
        })
    }

    pub fn expiration_as_string(&self) -> String {
        if self.expiration == 0 {
            String::from("Never")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…