cm0002@lemmy.world to Programmer Humor@programming.dev · 2 months agoI'm new to using Ruby and this tickled me pinklemmy.mlimagemessage-square4linkfedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageI'm new to using Ruby and this tickled me pinklemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 2 months agomessage-square4linkfedilink
minus-squareDiplomjodler@lemmy.worldlinkfedilinkarrow-up0·2 months agoThe Python won’t give an accurate date here because it doesn’t take into account leap years.
minus-squarertxn@lemmy.worldlinkfedilinkarrow-up1·2 months agotimedelta 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.
minus-squarenilloc@discuss.tchncs.delinkfedilinkEnglisharrow-up1·1 month ago365.25*10 would at least get you closer.
The Python won’t give an accurate date here because it doesn’t take into account leap years.
timedelta
marks time in days, seconds, and microseconds. It doesn’t take leap years into account because the concept of years is irrelevant totimedelta
. If you need to account for leap years, you need a different API.365.25*10 would at least get you closer.