diff --git a/lnbits/db.py b/lnbits/db.py index e6fbede66..7116eaf6e 100644 --- a/lnbits/db.py +++ b/lnbits/db.py @@ -643,6 +643,9 @@ def dict_to_model(_row: dict, model: type[TModel]) -> TModel: logger.warning(f"Converting {key} to model `{model}`.") continue type_ = model.__fields__[key].type_ + if issubclass(type_, datetime.datetime): + _dict[key] = datetime.datetime.fromtimestamp(value) + continue if issubclass(type_, bool): _dict[key] = bool(value) continue