aboutsummaryrefslogtreecommitdiff
path: root/src/utils/time.rs
blob: 903f30167d41e20ee1dd7099b8bb4b881089f8b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::config::CONFIG;
use crate::types::ThreadsData;
use chrono::prelude::*;

pub async fn get_time() -> ThreadsData {
    let now = Local::now();

    let data = format!(
        "  {}  {}  {}",
        CONFIG.time.icon,
        now.format(&CONFIG.time.format),
        CONFIG.seperator
    );
    ThreadsData::Time(data)
}