Rename timestamp_to_datetime to utcfromtimestamp.

It is what it is.
This commit is contained in:
voussoir 2022-07-21 17:21:49 -07:00
parent 6683c65784
commit 47c879764a
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
2 changed files with 3 additions and 3 deletions

View file

@ -456,7 +456,7 @@ def split_easybake_string(ebstring) -> tuple[str, str, str]:
tagname = tagname.strip('.')
return (tagname, synonym, rename_to)
def timestamp_to_datetime(unix):
def utcfromtimestamp(unix):
return datetime.datetime.utcfromtimestamp(unix).replace(tzinfo=datetime.timezone.utc)
def zip_album(album, recursive=True) -> zipstream.ZipFile:

View file

@ -81,7 +81,7 @@ class ObjectBase(worms.Object):
def created(self) -> datetime.datetime:
if self._created_dt is not None:
return self._created_dt
self._created_dt = helpers.timestamp_to_datetime(self.created_unix)
self._created_dt = helpers.utcfromtimestamp(self.created_unix)
return self._created_dt
class GroupableMixin(metaclass=abc.ABCMeta):
@ -1512,7 +1512,7 @@ class Photo(ObjectBase):
def tagged_at(self) -> datetime.datetime:
if self._tagged_at_dt is not None:
return self._tagged_at_dt
self._tagged_at_dt = helpers.timestamp_to_datetime(self.tagged_at_unix)
self._tagged_at_dt = helpers.utcfromtimestamp(self.tagged_at_unix)
return self._tagged_at_dt
class Tag(ObjectBase, GroupableMixin):