Skip to content

Conversation

@mynhardtburger
Copy link
Member

@mynhardtburger mynhardtburger commented Dec 18, 2025

Description

Replaces the use of the depreciated datetime.utcfromtimestamp(timestamp) with datetime.fromtimestamp(timestamp, tz=timezone.utc).replace(tzinfo=None). This preserves the exiting timezone naive behaviour.

The approach is copied from boto/botocore#3239 and https://blog.miguelgrinberg.com/post/it-s-time-for-a-change-datetime-utcnow-is-now-deprecated

Changes

What changes are included in this PR?

Testing

image

Signed-off-by: Mynhardt Burger <mynhardt@gmail.com>
@mynhardtburger mynhardtburger force-pushed the Resolve-.utcfromtimestamp-DepreciationWarning branch from 33e0112 to 03e2249 Compare December 18, 2025 16:20
@mynhardtburger mynhardtburger marked this pull request as ready for review December 18, 2025 16:34
Copy link
Collaborator

@gabe-l-hart gabe-l-hart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is a nice improvement

@gabe-l-hart gabe-l-hart merged commit 8f0ff2f into IBM:main Dec 18, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants