Tesco's Burger Relish Best Before End date number Given a date between 2010-01-01 and 2099-12-31 as three integers (please state your order if not [year,month,day]), answer with Tesco's corresponding five-digit Burger Relish Best Before End date number.

The format is simply the last two digits of the year, followed immediately by three digits representing the day of that year, between 000 and 365.

Cookies if you can do this using only numeric operations and comparisons. You may put such code separately from your golfed code, if it isn't also the shortest code you have.

Test cases

[year,month,day] → BRBBED:

[2010,1,1] → 10000

[2019,7,5] → 19185

[2020,5,20] → 20140

[2096,12,31] → 96365

[2099,12,31] → 99364
PowerShell, 74 70 67 bytes



param($y,$m,$d)-join"$y 00$((date "$m/$d/$y"|% d*r)-1)"[2,3+-3..-1]


Try it online!

Exactly what it says on the tin (but formatted weirdly). Takes in $year, $month, $day, plucks out the last two digits of the $year, gets a .NET datetime object of the specified day, then gets the dayofyear (with |% d*r) thereof. Subtracts one to make it zero-indexed, then uses string formatting and slicing to make it three-padded (e.g., 000 instead of 0), and then -joins it all together into a single string with implicit output.

Note this is culture dependent due to the datetime formatting. This works in en-us, which is what TIO also uses.

-3 bytes thanks to mazzy