Rename timestamp_to_datetime to utcfromtimestamp.
It is what it is.
This commit is contained in:
parent
6683c65784
commit
47c879764a
2 changed files with 3 additions and 3 deletions
|
@ -456,7 +456,7 @@ def split_easybake_string(ebstring) -> tuple[str, str, str]:
|
||||||
tagname = tagname.strip('.')
|
tagname = tagname.strip('.')
|
||||||
return (tagname, synonym, rename_to)
|
return (tagname, synonym, rename_to)
|
||||||
|
|
||||||
def timestamp_to_datetime(unix):
|
def utcfromtimestamp(unix):
|
||||||
return datetime.datetime.utcfromtimestamp(unix).replace(tzinfo=datetime.timezone.utc)
|
return datetime.datetime.utcfromtimestamp(unix).replace(tzinfo=datetime.timezone.utc)
|
||||||
|
|
||||||
def zip_album(album, recursive=True) -> zipstream.ZipFile:
|
def zip_album(album, recursive=True) -> zipstream.ZipFile:
|
||||||
|
|
|
@ -81,7 +81,7 @@ class ObjectBase(worms.Object):
|
||||||
def created(self) -> datetime.datetime:
|
def created(self) -> datetime.datetime:
|
||||||
if self._created_dt is not None:
|
if self._created_dt is not None:
|
||||||
return self._created_dt
|
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
|
return self._created_dt
|
||||||
|
|
||||||
class GroupableMixin(metaclass=abc.ABCMeta):
|
class GroupableMixin(metaclass=abc.ABCMeta):
|
||||||
|
@ -1512,7 +1512,7 @@ class Photo(ObjectBase):
|
||||||
def tagged_at(self) -> datetime.datetime:
|
def tagged_at(self) -> datetime.datetime:
|
||||||
if self._tagged_at_dt is not None:
|
if self._tagged_at_dt is not None:
|
||||||
return self._tagged_at_dt
|
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
|
return self._tagged_at_dt
|
||||||
|
|
||||||
class Tag(ObjectBase, GroupableMixin):
|
class Tag(ObjectBase, GroupableMixin):
|
||||||
|
|
Loading…
Reference in a new issue