cm0002@lemmy.world to Programmer Humor@programming.dev · 4 days agoI'm new to using Ruby and this tickled me pinkimagemessage-square66linkfedilinkarrow-up1242arrow-down12
arrow-up1240arrow-down1imageI'm new to using Ruby and this tickled me pinkcm0002@lemmy.world to Programmer Humor@programming.dev · 4 days agomessage-square66linkfedilink
minus-squarertxn@lemmy.worldlinkfedilinkarrow-up25arrow-down1·4 days 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·2 days ago365.25*10 would at least get you closer.
minus-squareRandelung@lemmy.worldlinkfedilinkarrow-up1·3 days agoYou can subtract two dates and get the exact time difference.
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.
You can subtract two dates and get the exact time difference.