diff options
author | 2022-07-09 00:11:48 +0530 | |
---|---|---|
committer | 2022-07-09 00:11:48 +0530 | |
commit | f0e484878af5b86b723de6af5f506f8b18e66ddc (patch) | |
tree | 0e688955119acf9598a85fdcba77ce21c104b327 /src/Watcher/time_operations.py | |
parent | 255487a34700d6790a2771a177c16991caaca72f (diff) | |
parent | ac79bbea7b113613bf160512064b8e2478181db9 (diff) | |
download | shopno-os-log-sync-f0e484878af5b86b723de6af5f506f8b18e66ddc.tar.gz shopno-os-log-sync-f0e484878af5b86b723de6af5f506f8b18e66ddc.zip |
Update 1.2 | AFK feature | New algorithm to update log file at each second
Diffstat (limited to '')
-rwxr-xr-x | src/Watcher/time_operations.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Watcher/time_operations.py b/src/Watcher/time_operations.py index df593b8..b7d3224 100755 --- a/src/Watcher/time_operations.py +++ b/src/Watcher/time_operations.py @@ -14,13 +14,15 @@ def time_difference(a,b): # b - a mn = 60 + mn if hr < 0: hr = hr + 24 +<<<<<<< HEAD +======= +>>>>>>> afk_feature elif sec < 0 and mn > 0: sec = 60 + sec mn = mn - 1 if hr < 0: hr = hr + 24 - elif sec < 0 and mn == 0: hr = hr - 1 mn = 59 @@ -52,7 +54,6 @@ def time_addition(a,b): mn = str(mn).zfill(2) sec = str(sec).zfill(2) result = hr + ":" + mn + ":" + sec - return result def format_time(t): @@ -69,3 +70,4 @@ def convert_into_sec(t): sec = int(t[0:2])*3600 + int(t[3:5])*60 + int(t[6::]) return sec + |