Skip to content
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

Do not use deprecated utcnow in ipython log line: #895

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

salomon-smekecohen
Copy link
Contributor

@salomon-smekecohen salomon-smekecohen commented Apr 29, 2024

Closes #893

💸 TL;DR

See issue 893.

🧪 Testing Steps / Validation

a = datetime.datetime.now(datetime.UTC).replace(tzinfo=None).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
b = datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
c = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%fZ")

print("\n".join((a,b,c)))

# 2024-04-29T19:06:01.275418Z
# 2024-04-29T19:06:01.275460Z
# 2024-04-29T19:06:01.275501Z

Python 3.8:
Screenshot 2024-04-29 at 2 47 09 PM

Python 3.12:
Screenshot 2024-04-29 at 2 47 33 PM

✅ Checks

  • CI tests (if present) are passing
  • Adheres to code style for repo
  • Contributor License Agreement (CLA) completed if not a Reddit employee

@salomon-smekecohen salomon-smekecohen marked this pull request as ready for review April 29, 2024 19:11
@salomon-smekecohen salomon-smekecohen requested a review from a team as a code owner April 29, 2024 19:11
@salomon-smekecohen
Copy link
Contributor Author

salomon-smekecohen commented Apr 29, 2024

this does not work in 3.8, I am trying other solutions.

got it.

a = datetime.datetime.now(datetime.UTC).replace(tzinfo=None).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
b = datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%dT%H:%M:%S.%fZ")
c = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.%fZ")

print("\n".join((a,b,c)))

\# 2024-04-29T19:06:01.275418Z
\# 2024-04-29T19:06:01.275460Z
\# 2024-04-29T19:06:01.275501Z
Copy link
Member

@chriskuehl chriskuehl left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this!

@chriskuehl chriskuehl merged commit 08af744 into reddit:develop Apr 29, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

UTCNow: Deprecation issue in baseplate-shell
3 participants