Thanks for that davidleo, I had a go at it myself in the mean time but in a way more roudabout way compared to yours.
//Take into account leap year
$puts(FP.feb,$ifgreater($mod($year(%first_played%),4),0,28,29))
$puts(LP.feb,$ifgreater($mod($year(%last_played%),4),0,28,29))
//days for months FP
$puts(FP.monthdays_total,
$ifequal($right($month(%first_played%),2),01,31,
$ifequal($right($month(%first_played%),2),02,$get(FP.feb),
$ifequal($right($month(%first_played%),2),03,31,
$ifequal($right($month(%first_played%),2),04,30,
$ifequal($right($month(%first_played%),2),05,31,
$ifequal($right($month(%first_played%),2),06,30,
$ifequal($right($month(%first_played%),2),07,31,
$ifequal($right($month(%first_played%),2),08,31,
$ifequal($right($month(%first_played%),2),09,30,
$ifequal($right($month(%first_played%),2),10,31,
$ifequal($right($month(%first_played%),2),11,30,
$ifequal($right($month(%first_played%),2),12,31,
))))))))))))
)
//days for months LP
$puts(LP.monthdays_total,
$ifequal($right($month(%first_played%),2),01,31,
$ifequal($right($month(%first_played%),2),02,$get(LP.feb),
$ifequal($right($month(%first_played%),2),03,31,
$ifequal($right($month(%first_played%),2),04,30,
$ifequal($right($month(%first_played%),2),05,31,
$ifequal($right($month(%first_played%),2),06,30,
$ifequal($right($month(%first_played%),2),07,31,
$ifequal($right($month(%first_played%),2),08,31,
$ifequal($right($month(%first_played%),2),09,30,
$ifequal($right($month(%first_played%),2),10,31,
$ifequal($right($month(%first_played%),2),11,30,
$ifequal($right($month(%first_played%),2),12,31,
))))))))))))
)
//Days for months count
$puts(jan.count,31)
$puts(feb.count,$add($get(jan.count),28))
$puts(march.count,$add($get(feb.count),31))
$puts(april.count,$add($get(march.count),30))
$puts(may.count,$add($get(april.count),31))
$puts(june.count,$add($get(may.count),30))
$puts(july.count,$add($get(june.count),31))
$puts(aug.count,$add($get(july.count),31))
$puts(sept.count,$add($get(aug.count),30))
$puts(oct.count,$add($get(sept.count),31))
$puts(nov.count,$add($get(oct.count),30))
$puts(dec.count,$add($get(nov.count),31))
//first played
$puts(FP.monthdays,
$ifequal($right($month(%first_played%),2),01,$get(jan.count),
$ifequal($right($month(%first_played%),2),02,$get(feb.count),
$ifequal($right($month(%first_played%),2),03,$get(march.count),
$ifequal($right($month(%first_played%),2),04,$get(april.count),
$ifequal($right($month(%first_played%),2),05,$get(may.count),
$ifequal($right($month(%first_played%),2),06,$get(june.count),
$ifequal($right($month(%first_played%),2),07,$get(july.count),
$ifequal($right($month(%first_played%),2),08,$get(aug.count),
$ifequal($right($month(%first_played%),2),09,$get(sept.count),
$ifequal($right($month(%first_played%),2),10,$get(oct.count),
$ifequal($right($month(%first_played%),2),11,$get(nov.count),
$ifequal($right($month(%first_played%),2),12,$get(dec.count),
))))))))))))
)
//Last played
$puts(LP.monthdays,
$ifequal($right($month(%last_played%),2),01,$get(jan.count),
$ifequal($right($month(%last_played%),2),02,$get(feb.count),
$ifequal($right($month(%last_played%),2),03,$get(march.count),
$ifequal($right($month(%last_played%),2),04,$get(april.count),
$ifequal($right($month(%last_played%),2),05,$get(may.count),
$ifequal($right($month(%last_played%),2),06,$get(june.count),
$ifequal($right($month(%last_played%),2),07,$get(july.count),
$ifequal($right($month(%last_played%),2),08,$get(aug.count),
$ifequal($right($month(%last_played%),2),09,$get(sept.count),
$ifequal($right($month(%last_played%),2),10,$get(oct.count),
$ifequal($right($month(%last_played%),2),11,$get(nov.count),
$ifequal($right($month(%last_played%),2),12,$get(dec.count),
))))))))))))
)
//Calculate FP
$puts(year_FP.calc,$mul($year(%first_played%),365))
$puts(month_FP.calc,$sub(365,$get(FP.monthdays)))
$puts(day_FP.calc,$sub($get(FP.monthdays_total),$day_of_month(%first_played%)))
//Calculate LP
$puts(year_LP.calc,$mul($year(%last_played%),365))
$puts(month_LP.calc,$sub(365,$get(LP.monthdays)))
$puts(day_LP.calc,$sub($get(LP.monthdays_total),$day_of_month(%last_played%)))
$puts(FP_result,$sub($get(year_FP.calc),$add($get(month_FP.calc),$get(day_FP.calc))))
$puts(LP_result,$sub($get(year_LP.calc),$add($get(month_LP.calc),$get(day_LP.calc))))
//Subtract results
$puts(result,$sub($get(LP_result),$get(FP_result)))
You didn't make a mistake, our results are similar (it seems yours includes end date as well). But it seems you have the same problem as I encountered namely the leap years in between very long date gaps. Leap years are taken into account when the leap year is detected (using $mod, but I didn't bother with the 100 and 400 divider) on the first_played and last_played date but not in between the dates as far as I noticed. But it's close enough. Gonna dump my script and be using yours.
Btw, this site is handy to verify results.