You've already forked neo64fetch
mirror of
https://github.com/neoarz/neo64fetch.git
synced 2026-02-20 04:03:27 +01:00
init
This commit is contained in:
11
src/helpers/uptime.rs
Normal file
11
src/helpers/uptime.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
pub fn get_uptime(seconds: u64) -> String {
|
||||
let days = seconds / 86400;
|
||||
let hours = (seconds % 86400) / 3600;
|
||||
let minutes = (seconds % 3600) / 60;
|
||||
|
||||
if days > 0 {
|
||||
format!("{} days, {} hours, {} minutes", days, hours, minutes)
|
||||
} else {
|
||||
format!("{} hours, {} minutes", hours, minutes)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user