this post was submitted on 24 Aug 2025
451 points (98.9% liked)

Programmer Humor

26026 readers
1543 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] rtxn@lemmy.world 25 points 6 days ago (2 children)

timedelta marks time in days, seconds, and microseconds. It doesn't take leap years into account because the concept of years is irrelevant to timedelta. If you need to account for leap years, you need a different API.

[–] nilloc@discuss.tchncs.de 1 points 4 days ago

365.25*10 would at least get you closer.

[–] Randelung@lemmy.world 1 points 5 days ago

You can subtract two dates and get the exact time difference.