Hide real build time of application
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-12-05 10:10:00 +01:00
parent b72fa90b67
commit 9535ab754a
4 changed files with 15 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
use chrono::DateTime;
use chrono::{DateTime, Local, NaiveTime};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
/// Get the current time since epoch
@@ -37,6 +37,14 @@ pub fn build_time() -> u64 {
date.timestamp() as u64
}
/// Get the first second of the day (local time)
pub fn time_start_of_day() -> u64 {
let local: DateTime<Local> = Local::now()
.with_time(NaiveTime::from_hms_opt(0, 0, 0).unwrap())
.unwrap();
local.timestamp() as u64
}
#[cfg(test)]
mod test {
use crate::utils::time_utils::{fmt_time, time};