Skip to content

Commit

Permalink
Merge pull request #85 from parea-ai/use-time-strf
Browse files Browse the repository at this point in the history
use time.strftime for to_date_and_time_string
  • Loading branch information
jalexanderII committed Sep 9, 2023
2 parents 8c35ee4 + 63cd6fa commit 7303d2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions parea/helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import time
import uuid
from datetime import datetime


def gen_trace_id() -> str:
Expand All @@ -8,5 +8,4 @@ def gen_trace_id() -> str:


def to_date_and_time_string(timestamp: float) -> str:
"""Convert a timestamp to a date and time string"""
return datetime.fromtimestamp(timestamp).strftime("%Y-%m-%d %H:%M:%S %Z").strip()
return time.strftime("%Y-%m-%d %H:%M:%S %Z", time.localtime(timestamp))
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "parea-ai"
packages = [{ include = "parea" }]
version = "0.2.6"
version = "0.2.7a0"
description = "Parea python sdk"
readme = "README.md"
authors = ["joel-parea-ai <[email protected]>"]
Expand Down

0 comments on commit 7303d2c

Please sign in to comment.