mirror of
https://github.com/boltgolt/howdy.git
synced 2024-09-19 09:51:19 +02:00
Update other areas where datetime is invoked
This commit is contained in:
parent
03e3efaee2
commit
cd808762c9
2 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
# Import required modules
|
# Import required modules
|
||||||
import os
|
import os
|
||||||
import configparser
|
import configparser
|
||||||
import datetime
|
from datetime import timezone, datetime
|
||||||
import snapshot
|
import snapshot
|
||||||
import paths_factory
|
import paths_factory
|
||||||
from recorders.video_capture import VideoCapture
|
from recorders.video_capture import VideoCapture
|
||||||
|
@ -41,7 +41,7 @@ while True:
|
||||||
# Generate a snapshot image from the frames
|
# Generate a snapshot image from the frames
|
||||||
file = snapshot.generate(frames, [
|
file = snapshot.generate(frames, [
|
||||||
_("GENERATED SNAPSHOT"),
|
_("GENERATED SNAPSHOT"),
|
||||||
_("Date: ") + datetime.datetime.utcnow().strftime("%Y/%m/%d %H:%M:%S UTC"),
|
_("Date: ") + datetime.now(timezone.utc).strftime("%Y/%m/%d %H:%M:%S UTC"),
|
||||||
_("Dark threshold config: ") + str(config.getfloat("video", "dark_threshold", fallback=60.0)),
|
_("Dark threshold config: ") + str(config.getfloat("video", "dark_threshold", fallback=60.0)),
|
||||||
_("Certainty config: ") + str(config.getfloat("video", "certainty", fallback=3.5))
|
_("Certainty config: ") + str(config.getfloat("video", "certainty", fallback=3.5))
|
||||||
])
|
])
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Import modules
|
# Import modules
|
||||||
import cv2
|
import cv2
|
||||||
import os
|
import os
|
||||||
import datetime
|
from datetime import timezone, datetime
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import paths_factory
|
import paths_factory
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ def generate(frames, text_lines):
|
||||||
os.makedirs(paths_factory.snapshots_dir_path())
|
os.makedirs(paths_factory.snapshots_dir_path())
|
||||||
|
|
||||||
# Generate a filename based on the current time
|
# Generate a filename based on the current time
|
||||||
filename = datetime.datetime.utcnow().strftime("%Y%m%dT%H%M%S.jpg")
|
filename = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%S.jpg")
|
||||||
filepath = paths_factory.snapshot_path(filename)
|
filepath = paths_factory.snapshot_path(filename)
|
||||||
# Write the image to that file
|
# Write the image to that file
|
||||||
cv2.imwrite(filepath, snap)
|
cv2.imwrite(filepath, snap)
|
||||||
|
|
Loading…
Reference in a new issue