this post was submitted on 24 Aug 2025
279 points (97.6% liked)

Programmer Humor

38240 readers
73 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] dumples@midwest.social 7 points 2 weeks ago (2 children)

Python does have a year option that they are not using. Depending on the application I would use 365 for a year to get a consistent number of days.

[–] cypherpunks@lemmy.ml 1 points 6 days ago* (last edited 6 days ago) (1 children)

Python does have a year option that they are not using.

No, it doesn't:

help(datetime.timedelta)

Help on class timedelta in module datetime:

class timedelta(builtins.object)
 |  Difference between two datetime values.
 |
 |  timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)
 |
 |  All arguments are optional and default to 0.
 |  Arguments may be integers or floats, and may be positive or negative.

[–] dumples@midwest.social 1 points 5 days ago

Your right. I was thinking about pd.DateOffset()

[–] sunshine@lemmy.ml 8 points 2 weeks ago

I did look up the help for that function to make this meme but I must have missed that option. in my defense I've only been using Python for like 10 years