Fix datetime prefix setting to pad one-digit values with a zero in audio recording

This commit is contained in:
Satu Koskinen 2022-10-22 14:39:10 +03:00
parent 3a2b209392
commit a1eccc0c3d

View File

@ -97,7 +97,7 @@ pub fn get_wav_spec(default_config: &SupportedStreamConfig, user_config: &Stream
pub fn get_date_time_string() -> String { pub fn get_date_time_string() -> String {
let now: DateTime<Local> = Local::now(); let now: DateTime<Local> = Local::now();
format!( format!(
"{}-{}-{}_{}:{}:{:02}", "{:02}-{:02}-{:02}_{:02}:{:02}:{:02}",
now.year(), now.month(), now.day(), now.year(), now.month(), now.day(),
now.hour(), now.minute(), now.second(), now.hour(), now.minute(), now.second(),
) )