From a1eccc0c3d09d08c4ed1b18b64ee05fcb1212c20 Mon Sep 17 00:00:00 2001 From: Satu Koskinen Date: Sat, 22 Oct 2022 14:39:10 +0300 Subject: [PATCH] Fix datetime prefix setting to pad one-digit values with a zero in audio recording --- audio-logger/src/getters.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio-logger/src/getters.rs b/audio-logger/src/getters.rs index 72b250c..e417977 100644 --- a/audio-logger/src/getters.rs +++ b/audio-logger/src/getters.rs @@ -97,7 +97,7 @@ pub fn get_wav_spec(default_config: &SupportedStreamConfig, user_config: &Stream pub fn get_date_time_string() -> String { let now: DateTime = Local::now(); format!( - "{}-{}-{}_{}:{}:{:02}", + "{:02}-{:02}-{:02}_{:02}:{:02}:{:02}", now.year(), now.month(), now.day(), now.hour(), now.minute(), now.second(), )