Skip to content

Commit

Permalink
fix date in daily log files
Browse files Browse the repository at this point in the history
  • Loading branch information
benderl committed Jan 16, 2024
1 parent f005423 commit 4dd5f71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/helpermodules/measurement_logging/write_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def save_log(folder):
gibt an, ob ein Tages-oder Monats-Log-Eintrag erstellt werden soll.
"""
if folder == "daily":
date = timecheck.create_timestamp()
date = timecheck.create_timestamp_HH_MM()
else:
date = timecheck.create_timestamp_YYYYMMDD()
current_timestamp = timecheck.create_timestamp()
Expand Down
4 changes: 4 additions & 0 deletions packages/helpermodules/timecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ def create_timestamp_YYYYMMDD() -> str:
return stamp


def create_timestamp_HH_MM() -> str:
return datetime.datetime.today().strftime("%H:%M")


def create_unix_timestamp_current_full_hour() -> int:
full_hour = datetime.datetime.fromtimestamp(create_timestamp()).strftime("%m/%d/%Y, %H")
return int(datetime.datetime.strptime(full_hour, "%m/%d/%Y, %H").timestamp())
Expand Down

0 comments on commit 4dd5f71

Please sign in to comment.