aboutsummaryrefslogtreecommitdiff
path: root/src/utils/time.rs
diff options
context:
space:
mode:
authorMustafa Salih <37256744+MustafaSalih1993@users.noreply.github.com>2021-01-14 05:43:01 +0300
committerGitHub <noreply@github.com>2021-01-14 05:43:01 +0300
commite38859e0f0106b60f2dd6d2f8260ea16e5417a96 (patch)
treeacdd23279a8fc837fa076739933b1269d74110fd /src/utils/time.rs
parente829871f2d757c7414763992839a584038c7b443 (diff)
parent6a349a0e0282e56b03adbe02b41bfaf0cc3213f1 (diff)
Merge pull request #34 from MustafaSalih1993/dev
orginized the code to seprated mods and deleted the lib file
Diffstat (limited to 'src/utils/time.rs')
-rw-r--r--src/utils/time.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/time.rs b/src/utils/time.rs
new file mode 100644
index 0000000..3149ce6
--- /dev/null
+++ b/src/utils/time.rs
@@ -0,0 +1,13 @@
+use crate::types::Config;
+use chrono::prelude::*;
+
+pub fn get_time(config: &Config) -> String {
+ let now = Local::now();
+
+ format!(
+ " {} {} {}",
+ config.time.icon,
+ now.format(&config.time.format),
+ config.seperator
+ )
+}