Skip to content

Commit

Permalink
Fix datetime utils function
Browse files Browse the repository at this point in the history
  • Loading branch information
cmutel committed May 12, 2024
1 parent 01adf38 commit c54331f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bw_processing/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime
import datetime
from io import BytesIO
from pathlib import Path
from typing import Any, Union
Expand Down Expand Up @@ -101,9 +101,9 @@ def resolve_dict_iterator(iterator: Any, nrows: int = None) -> tuple:
)


def utc_now() -> datetime:
def utc_now() -> datetime.datetime:
"""Get current datetime compatible with Py 3.8 to 3.12"""
if hasattr(datetime, "UTC"):
return datetime.now(datetime.UTC)
return datetime.datetime.now(datetime.UTC)
else:
return datetime.utcnow()
return datetime.datetime.utcnow()

0 comments on commit c54331f

Please sign in to comment.