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

[policies|auth] Move away from deprecated datetime.utcnow #3825

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcastill
Copy link
Member

Change calls to deprecated datetime.utcnow to datetime.now.


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname [email protected]?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

Change calls to deprecated datetime.utcnow to datetime.now.

Signed-off-by: Jose Castillo <[email protected]>
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3825
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@pmoravec
Copy link
Contributor

Be aware, datetime.utcnow() returns different time than datetime.now() when you are not in GMT timezone:

$ ( echo "from datetime import *"; echo "print(datetime.utcnow())"; echo "print(datetime.now())" ) | TZ=Australia/Sydney python3; date
2024-10-31 08:40:18.730206       # UTC time / utcnow()
2024-10-31 19:40:18.730253       # time in Sydney / now()
Thu Oct 31 09:40:18 CET 2024    # real time on my notebook in CET/UTC+1
$

The token data contains datetime in UTC, or in local timezone..?

@jcastill
Copy link
Member Author

IIrc the document I checked last time mentioned local timezone, but I'll check again.

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