Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deprecateutcnow andutcfromtimestamp #103857

Closed
Labels
type-featureA feature request or enhancement
@pganssle

Description

@pganssle

Feature or enhancement

Previously, we havedocumented thatutcnow andutcfromtimestamp should not be used, but we didn't go so far as to actually deprecate them, and I wrote a whole article abouthow you shouldn't use them.

The main reason I had for not deprecating them at the time was that.utcnow() is faster than.now(datetime.UTC), and if you are immediately converting the datetime to a string, likedatetime.utcnow().isoformat(), there's no danger.

I have come around to the idea that this type of use case is not important enough to leave theattractive nuisances ofutcnow() andutcfromtimestamp() in place, and we should go ahead and deprecate them.

Pitch

We should deprecate them in the documentation and also addDeprecationWarnings imploring people not to use them. I'm OK with us saying that we will remove them "at some point in the future" and not necessarily putting a deadline on it, considering how much use ofutcnow() is out there.

Previous discussion

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp