This version is extraordinary, I like it a lota lib less one liner based on @Star-Dust 's excellent (fixed) code...
I hope it fits the width of this forum
B4X:Public Sub dayOfYear (month As Int, dayOfMonth As Int,year As Int) As Int Return dayOfMonth+Bit.ParseInt(Regex.Split(",","0,0,31,59,90,120,151,181,212,243,273,304,335")(month),10)+2*(0.5-Min((year Mod 4),0.5)+Min((year Mod 100),0.5)-Min((year Mod 400),0.5))*Floor(Min(month,2)/2) End Sub