-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue_105 #121
issue_105 #121
Conversation
app/datetime.py
Outdated
return datetime.now(timezone.utc) | ||
|
||
|
||
def utc_from_timestamp(timestamp): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method has no usage anywhere, or it's just for future use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just for future use, can be deleted now
start_date: Mapped[datetime.datetime] = mapped_column( | ||
insert_default=func.now() | ||
start_date: Mapped[datetime] = mapped_column( | ||
db.DateTime, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is db.DateTime corect here? Before you used only one argument and now two
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an explicit indication of the data type
recheck |
Build succeeded. ✔️ otc-tox-docs SUCCESS in 3m 07s |
timestamp standardization: stackmon/status-dashboard#121 API fix stackmon/status-dashboard#122
Update Status Dashboard to latest version timestamp standardization: stackmon/status-dashboard#121 API fix stackmon/status-dashboard#122 Reviewed-by: Aloento
#105
Problem:
datetime: datetime.datetime’s utcnow() and utcfromtimestamp() are deprecated and will be removed in a future version. Instead, use timezone-aware objects to represent datetimes in UTC: respectively, call now() and fromtimestamp() with the tz parameter set to datetime.UTC. (Contributed by Paul Ganssle in gh-103857.)
Solution:
To add new function to get actual datetime_now with timezone and remove timezone to save the datebase models unchanged (to use postgresql and sqlite).
Conclusion:
All timestamps converts to utc timezone and stores without timezone in the database