Tesco's Burger Relish Best Before End date numberCalculate the day number of the yearHow long until this date?Resolving the Date Format DisputeCalculate the day number of the yearLegalize Reversed DateWhat's the Date?Date OccurrencesConvert an Excel date code to a “date”Get the date of the nth day of week in a given year and monthMis-decode a dateOutput the date in the Mel calendar

Did William Shakespeare hide things in his writings?

Examples of fluid (including air) being used to transmit digital data?

What are some bad ways to subvert tropes?

What is the shape of the upper boundary of water hitting a screen?

Which is a better conductor, a very thick rubber wire or a very thin copper wire?

Can we share mixing jug/beaker for developer, fixer and stop bath?

Why does the Misal rico de Cisneros uses the word "Qiſſa", and what is it supposed to mean? Why not "Miſſa" (Missa)?

Array or vector? Two dimensional array or matrix?

How do I talk to my wife about unrealistic expectations?

How can I review my manager, who is fine?

Uniform initialization by tuple

What purpose does mercury dichloride have in fireworks?

Where are the Wazirs?

Can the Four Elements monk's Shape the Flowing River elemental discipline create stairs by expending a single ki point?

How was the website able to tell my credit card was wrong before it processed it?

Tesco's Burger Relish Best Before End date number

How did the Time Lords put a whole "Star" in a Tardis?

Sorting a list according to some pre-specified rules

What is this burst transmission sequence across the entire band?

Why did the frequency of the word "черт" (devil) in books increase by a few times since the October Revolution?

How to deal with account scam and fraud?

Intern not wearing safety equipment; how could I have handled this differently?

How to reclaim personal item I've lent to the office without burning bridges?

First road bike, decade old quality or lower end and new?



Tesco's Burger Relish Best Before End date number


Calculate the day number of the yearHow long until this date?Resolving the Date Format DisputeCalculate the day number of the yearLegalize Reversed DateWhat's the Date?Date OccurrencesConvert an Excel date code to a “date”Get the date of the nth day of week in a given year and monthMis-decode a dateOutput the date in the Mel calendar






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2












$begingroup$


Tesco Burger Relish BBE: 20140



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










share|improve this question











$endgroup$











  • $begingroup$
    "Cookies if you can do this using only numeric operations." Good luck handling dates without e.g. comparison operators...
    $endgroup$
    – Erik the Outgolfer
    7 hours ago










  • $begingroup$
    @EriktheOutgolfer Addressed.
    $endgroup$
    – Adám
    7 hours ago










  • $begingroup$
    Closely related
    $endgroup$
    – Arnauld
    7 hours ago






  • 1




    $begingroup$
    @Arnauld But that's a do-X-without-Y with an input domain that makes things harder.
    $endgroup$
    – Adám
    7 hours ago










  • $begingroup$
    Oh indeed. I missed that rule in the linked challenge.
    $endgroup$
    – Arnauld
    7 hours ago

















2












$begingroup$


Tesco Burger Relish BBE: 20140



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










share|improve this question











$endgroup$











  • $begingroup$
    "Cookies if you can do this using only numeric operations." Good luck handling dates without e.g. comparison operators...
    $endgroup$
    – Erik the Outgolfer
    7 hours ago










  • $begingroup$
    @EriktheOutgolfer Addressed.
    $endgroup$
    – Adám
    7 hours ago










  • $begingroup$
    Closely related
    $endgroup$
    – Arnauld
    7 hours ago






  • 1




    $begingroup$
    @Arnauld But that's a do-X-without-Y with an input domain that makes things harder.
    $endgroup$
    – Adám
    7 hours ago










  • $begingroup$
    Oh indeed. I missed that rule in the linked challenge.
    $endgroup$
    – Arnauld
    7 hours ago













2












2








2





$begingroup$


Tesco Burger Relish BBE: 20140



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










share|improve this question











$endgroup$




Tesco Burger Relish BBE: 20140



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







code-golf number date conversion






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 7 hours ago







Adám

















asked 8 hours ago









AdámAdám

28.3k2 gold badges79 silver badges210 bronze badges




28.3k2 gold badges79 silver badges210 bronze badges











  • $begingroup$
    "Cookies if you can do this using only numeric operations." Good luck handling dates without e.g. comparison operators...
    $endgroup$
    – Erik the Outgolfer
    7 hours ago










  • $begingroup$
    @EriktheOutgolfer Addressed.
    $endgroup$
    – Adám
    7 hours ago










  • $begingroup$
    Closely related
    $endgroup$
    – Arnauld
    7 hours ago






  • 1




    $begingroup$
    @Arnauld But that's a do-X-without-Y with an input domain that makes things harder.
    $endgroup$
    – Adám
    7 hours ago










  • $begingroup$
    Oh indeed. I missed that rule in the linked challenge.
    $endgroup$
    – Arnauld
    7 hours ago
















  • $begingroup$
    "Cookies if you can do this using only numeric operations." Good luck handling dates without e.g. comparison operators...
    $endgroup$
    – Erik the Outgolfer
    7 hours ago










  • $begingroup$
    @EriktheOutgolfer Addressed.
    $endgroup$
    – Adám
    7 hours ago










  • $begingroup$
    Closely related
    $endgroup$
    – Arnauld
    7 hours ago






  • 1




    $begingroup$
    @Arnauld But that's a do-X-without-Y with an input domain that makes things harder.
    $endgroup$
    – Adám
    7 hours ago










  • $begingroup$
    Oh indeed. I missed that rule in the linked challenge.
    $endgroup$
    – Arnauld
    7 hours ago















$begingroup$
"Cookies if you can do this using only numeric operations." Good luck handling dates without e.g. comparison operators...
$endgroup$
– Erik the Outgolfer
7 hours ago




$begingroup$
"Cookies if you can do this using only numeric operations." Good luck handling dates without e.g. comparison operators...
$endgroup$
– Erik the Outgolfer
7 hours ago












$begingroup$
@EriktheOutgolfer Addressed.
$endgroup$
– Adám
7 hours ago




$begingroup$
@EriktheOutgolfer Addressed.
$endgroup$
– Adám
7 hours ago












$begingroup$
Closely related
$endgroup$
– Arnauld
7 hours ago




$begingroup$
Closely related
$endgroup$
– Arnauld
7 hours ago




1




1




$begingroup$
@Arnauld But that's a do-X-without-Y with an input domain that makes things harder.
$endgroup$
– Adám
7 hours ago




$begingroup$
@Arnauld But that's a do-X-without-Y with an input domain that makes things harder.
$endgroup$
– Adám
7 hours ago












$begingroup$
Oh indeed. I missed that rule in the linked challenge.
$endgroup$
– Arnauld
7 hours ago




$begingroup$
Oh indeed. I missed that rule in the linked challenge.
$endgroup$
– Arnauld
7 hours ago










9 Answers
9






active

oldest

votes


















2












$begingroup$


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






share|improve this answer











$endgroup$












  • $begingroup$
    -1 byte
    $endgroup$
    – mazzy
    5 hours ago






  • 1




    $begingroup$
    @mazzy Don't need the parens in -join(...) since it's a single string slice, then. So that's another -2. Thanks!
    $endgroup$
    – AdmBorkBork
    5 hours ago


















2












$begingroup$


PowerShell, 48 45 bytes



Port of Expired Data's answer for C#





$args[0]*1E3+($args-join'-'|date|% d*r)-2E6-1


Try it online!





PowerShell, 60 58 bytes



-2 bytes thanks @AdmBorkBork





-join"$args 00$(($args-join'-'|date|% d*r)-1)"[2,3+-3..-1]


Try it online!



Explanation:



  • The script takes three integers [year,month,day]


  • $args-join'-' makes ISO date string like YYYY-MM-DD


  • ('YYYY-MM-DD'|date|% d*r)-1 calculates dayOfYear

  • the script makes a result string like YYYY MM DD 00### where ### is dayOfYear

  • finally the script extracts chars from positions [2,3+-3..-1] of the result string and joins this chars to result





share|improve this answer











$endgroup$








  • 1




    $begingroup$
    Clever use of $args.
    $endgroup$
    – AdmBorkBork
    5 hours ago






  • 1




    $begingroup$
    Just like with my answer, you only have a single string slice, so you don't need parens in -join(...) for -2 bytes. Try it online!
    $endgroup$
    – AdmBorkBork
    5 hours ago






  • 1




    $begingroup$
    Nice port! I knew there'd be a good way in PowerShell, but I didn't think it'd be that good
    $endgroup$
    – Expired Data
    4 hours ago


















1












$begingroup$


Python 2, 63 61 57 bytes





lambda y,m,d:y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33


Try it online!



Returns the result as an integer.



Neil found that his Charcoal approach turned out to be lucky after some rearrangement.



Pure arithmetic and comparison solution (61 bytes):



lambda y,m,d:y%100*1000+30*m+m/2+(8<m<12)+~(0<y%4)*(2<m)+d-31





share|improve this answer











$endgroup$












  • $begingroup$
    Seems to be a day off for January and February?
    $endgroup$
    – Neil
    3 hours ago










  • $begingroup$
    @Neil Oh LOL I just noticed I was subtracting the extra day February doesn't have even when that month hasn't passed yet. EDIT: should be fixed.
    $endgroup$
    – Erik the Outgolfer
    3 hours ago











  • $begingroup$
    I ported my Charcoal solution, and then golfed it down to 57 bytes: y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33. (Sadly this rearrangement has the same byte count in Charcoal.)
    $endgroup$
    – Neil
    3 hours ago










  • $begingroup$
    @Neil LOL Charcoal thinking beats Python thinking 10/10 I guess. :D I'll add it and see what I can further do, if I can.
    $endgroup$
    – Erik the Outgolfer
    3 hours ago


















1












$begingroup$


C# (Visual C# Interactive Compiler), 88 78 73 71 59 57 bytes





a=>a[0]%100*1000+new DateTime(a[0],a[1],a[2]).DayOfYear-1


Try it online!






share|improve this answer











$endgroup$




















    1












    $begingroup$


    Python 3, 87 85 74 bytes





    lambda y,m,d:sum([y*1000-2000029+28*m,3,y%4==0,3,2,3,2,3,3,2,3,2,3][:m])+d


    Try it online!



    This is using only numeric operations and comparisons.






    share|improve this answer











    $endgroup$




















      0












      $begingroup$


      Ruby, 40 bytes





      ->dTime.gm(*d).strftime('%y%j').to_i-1


      Try it online!



      So close to being a built-in format, but %j is 1-indexed.



      In a happier coincidence, though, Tesco Time (.gm) is one character shorter than local time (.new).






      share|improve this answer









      $endgroup$




















        0












        $begingroup$


        Charcoal, 33 bytes



        IΣ⟦×φ﹪θ¹⁰⁰⊖ζ÷⊕×¹⁵³⊖η⁵⎇›η²⊖⊖¬﹪θ⁴⊖η


        Try it online! Link is to verbose version of code. Try it online! Link includes test suite. I don't think Charcoal has any date functions, so here's a mathematical solution. Explanation:



         ×φ﹪θ¹⁰⁰ Year * 1000
        ⊖ζ Day - 1
        ÷⊕×¹⁵³⊖η⁵ Days in previous months
        ⎇›η² For months after Februrary
        ⊖⊖¬﹪θ⁴ Adjust for leap years else
        ⊖η Adjust for short Februrary
        Σ⟦ Take the sum
        I Cast to string for implicit print





        share|improve this answer









        $endgroup$




















          0












          $begingroup$

          JavaScript, 70 57 bytes



          (y,m,d,U=Date.UTC)=>y%100*1e3+(U(y,m-1,d)-U(y,0,1))/864e5


          Try it online!






          share|improve this answer











          $endgroup$












          • $begingroup$
            59 bytes?
            $endgroup$
            – Arnauld
            4 hours ago











          • $begingroup$
            @Arnauld y%100*1e3 works because they have the same precedence.
            $endgroup$
            – Neil
            4 hours ago










          • $begingroup$
            Heh, I was overcomplicating it by using string concatenation when simple arithmetic is all that was needed. Thanks @Arnauld and @Neil!
            $endgroup$
            – darrylyeo
            3 hours ago










          • $begingroup$
            @darrylyeo something in the back of my head said -2000 was 1 byte too many but %100 was far too obvious!
            $endgroup$
            – Expired Data
            2 hours ago


















          0












          $begingroup$


          Japt, 23 bytes



          Takes input as 3 individual strings, assuming that's allowed.



          ¤+@ÐUTX ŶÐN Å}as ùT3 É


          Try it



          Very unhappy with this (there must be a better way to get the day of the year!) but it's been a long day. A port of darrylyeo's JS solution would be 2 bytes shorter but, for some reason, despite Japt being JavaScript, floating point inaccuracies abound.






          share|improve this answer









          $endgroup$















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "200"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f187723%2ftescos-burger-relish-best-before-end-date-number%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            9 Answers
            9






            active

            oldest

            votes








            9 Answers
            9






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2












            $begingroup$


            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






            share|improve this answer











            $endgroup$












            • $begingroup$
              -1 byte
              $endgroup$
              – mazzy
              5 hours ago






            • 1




              $begingroup$
              @mazzy Don't need the parens in -join(...) since it's a single string slice, then. So that's another -2. Thanks!
              $endgroup$
              – AdmBorkBork
              5 hours ago















            2












            $begingroup$


            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






            share|improve this answer











            $endgroup$












            • $begingroup$
              -1 byte
              $endgroup$
              – mazzy
              5 hours ago






            • 1




              $begingroup$
              @mazzy Don't need the parens in -join(...) since it's a single string slice, then. So that's another -2. Thanks!
              $endgroup$
              – AdmBorkBork
              5 hours ago













            2












            2








            2





            $begingroup$


            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






            share|improve this answer











            $endgroup$




            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







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 5 hours ago

























            answered 7 hours ago









            AdmBorkBorkAdmBorkBork

            28.4k4 gold badges70 silver badges245 bronze badges




            28.4k4 gold badges70 silver badges245 bronze badges











            • $begingroup$
              -1 byte
              $endgroup$
              – mazzy
              5 hours ago






            • 1




              $begingroup$
              @mazzy Don't need the parens in -join(...) since it's a single string slice, then. So that's another -2. Thanks!
              $endgroup$
              – AdmBorkBork
              5 hours ago
















            • $begingroup$
              -1 byte
              $endgroup$
              – mazzy
              5 hours ago






            • 1




              $begingroup$
              @mazzy Don't need the parens in -join(...) since it's a single string slice, then. So that's another -2. Thanks!
              $endgroup$
              – AdmBorkBork
              5 hours ago















            $begingroup$
            -1 byte
            $endgroup$
            – mazzy
            5 hours ago




            $begingroup$
            -1 byte
            $endgroup$
            – mazzy
            5 hours ago




            1




            1




            $begingroup$
            @mazzy Don't need the parens in -join(...) since it's a single string slice, then. So that's another -2. Thanks!
            $endgroup$
            – AdmBorkBork
            5 hours ago




            $begingroup$
            @mazzy Don't need the parens in -join(...) since it's a single string slice, then. So that's another -2. Thanks!
            $endgroup$
            – AdmBorkBork
            5 hours ago













            2












            $begingroup$


            PowerShell, 48 45 bytes



            Port of Expired Data's answer for C#





            $args[0]*1E3+($args-join'-'|date|% d*r)-2E6-1


            Try it online!





            PowerShell, 60 58 bytes



            -2 bytes thanks @AdmBorkBork





            -join"$args 00$(($args-join'-'|date|% d*r)-1)"[2,3+-3..-1]


            Try it online!



            Explanation:



            • The script takes three integers [year,month,day]


            • $args-join'-' makes ISO date string like YYYY-MM-DD


            • ('YYYY-MM-DD'|date|% d*r)-1 calculates dayOfYear

            • the script makes a result string like YYYY MM DD 00### where ### is dayOfYear

            • finally the script extracts chars from positions [2,3+-3..-1] of the result string and joins this chars to result





            share|improve this answer











            $endgroup$








            • 1




              $begingroup$
              Clever use of $args.
              $endgroup$
              – AdmBorkBork
              5 hours ago






            • 1




              $begingroup$
              Just like with my answer, you only have a single string slice, so you don't need parens in -join(...) for -2 bytes. Try it online!
              $endgroup$
              – AdmBorkBork
              5 hours ago






            • 1




              $begingroup$
              Nice port! I knew there'd be a good way in PowerShell, but I didn't think it'd be that good
              $endgroup$
              – Expired Data
              4 hours ago















            2












            $begingroup$


            PowerShell, 48 45 bytes



            Port of Expired Data's answer for C#





            $args[0]*1E3+($args-join'-'|date|% d*r)-2E6-1


            Try it online!





            PowerShell, 60 58 bytes



            -2 bytes thanks @AdmBorkBork





            -join"$args 00$(($args-join'-'|date|% d*r)-1)"[2,3+-3..-1]


            Try it online!



            Explanation:



            • The script takes three integers [year,month,day]


            • $args-join'-' makes ISO date string like YYYY-MM-DD


            • ('YYYY-MM-DD'|date|% d*r)-1 calculates dayOfYear

            • the script makes a result string like YYYY MM DD 00### where ### is dayOfYear

            • finally the script extracts chars from positions [2,3+-3..-1] of the result string and joins this chars to result





            share|improve this answer











            $endgroup$








            • 1




              $begingroup$
              Clever use of $args.
              $endgroup$
              – AdmBorkBork
              5 hours ago






            • 1




              $begingroup$
              Just like with my answer, you only have a single string slice, so you don't need parens in -join(...) for -2 bytes. Try it online!
              $endgroup$
              – AdmBorkBork
              5 hours ago






            • 1




              $begingroup$
              Nice port! I knew there'd be a good way in PowerShell, but I didn't think it'd be that good
              $endgroup$
              – Expired Data
              4 hours ago













            2












            2








            2





            $begingroup$


            PowerShell, 48 45 bytes



            Port of Expired Data's answer for C#





            $args[0]*1E3+($args-join'-'|date|% d*r)-2E6-1


            Try it online!





            PowerShell, 60 58 bytes



            -2 bytes thanks @AdmBorkBork





            -join"$args 00$(($args-join'-'|date|% d*r)-1)"[2,3+-3..-1]


            Try it online!



            Explanation:



            • The script takes three integers [year,month,day]


            • $args-join'-' makes ISO date string like YYYY-MM-DD


            • ('YYYY-MM-DD'|date|% d*r)-1 calculates dayOfYear

            • the script makes a result string like YYYY MM DD 00### where ### is dayOfYear

            • finally the script extracts chars from positions [2,3+-3..-1] of the result string and joins this chars to result





            share|improve this answer











            $endgroup$




            PowerShell, 48 45 bytes



            Port of Expired Data's answer for C#





            $args[0]*1E3+($args-join'-'|date|% d*r)-2E6-1


            Try it online!





            PowerShell, 60 58 bytes



            -2 bytes thanks @AdmBorkBork





            -join"$args 00$(($args-join'-'|date|% d*r)-1)"[2,3+-3..-1]


            Try it online!



            Explanation:



            • The script takes three integers [year,month,day]


            • $args-join'-' makes ISO date string like YYYY-MM-DD


            • ('YYYY-MM-DD'|date|% d*r)-1 calculates dayOfYear

            • the script makes a result string like YYYY MM DD 00### where ### is dayOfYear

            • finally the script extracts chars from positions [2,3+-3..-1] of the result string and joins this chars to result






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 5 hours ago

























            answered 5 hours ago









            mazzymazzy

            3,5461 gold badge4 silver badges19 bronze badges




            3,5461 gold badge4 silver badges19 bronze badges







            • 1




              $begingroup$
              Clever use of $args.
              $endgroup$
              – AdmBorkBork
              5 hours ago






            • 1




              $begingroup$
              Just like with my answer, you only have a single string slice, so you don't need parens in -join(...) for -2 bytes. Try it online!
              $endgroup$
              – AdmBorkBork
              5 hours ago






            • 1




              $begingroup$
              Nice port! I knew there'd be a good way in PowerShell, but I didn't think it'd be that good
              $endgroup$
              – Expired Data
              4 hours ago












            • 1




              $begingroup$
              Clever use of $args.
              $endgroup$
              – AdmBorkBork
              5 hours ago






            • 1




              $begingroup$
              Just like with my answer, you only have a single string slice, so you don't need parens in -join(...) for -2 bytes. Try it online!
              $endgroup$
              – AdmBorkBork
              5 hours ago






            • 1




              $begingroup$
              Nice port! I knew there'd be a good way in PowerShell, but I didn't think it'd be that good
              $endgroup$
              – Expired Data
              4 hours ago







            1




            1




            $begingroup$
            Clever use of $args.
            $endgroup$
            – AdmBorkBork
            5 hours ago




            $begingroup$
            Clever use of $args.
            $endgroup$
            – AdmBorkBork
            5 hours ago




            1




            1




            $begingroup$
            Just like with my answer, you only have a single string slice, so you don't need parens in -join(...) for -2 bytes. Try it online!
            $endgroup$
            – AdmBorkBork
            5 hours ago




            $begingroup$
            Just like with my answer, you only have a single string slice, so you don't need parens in -join(...) for -2 bytes. Try it online!
            $endgroup$
            – AdmBorkBork
            5 hours ago




            1




            1




            $begingroup$
            Nice port! I knew there'd be a good way in PowerShell, but I didn't think it'd be that good
            $endgroup$
            – Expired Data
            4 hours ago




            $begingroup$
            Nice port! I knew there'd be a good way in PowerShell, but I didn't think it'd be that good
            $endgroup$
            – Expired Data
            4 hours ago











            1












            $begingroup$


            Python 2, 63 61 57 bytes





            lambda y,m,d:y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33


            Try it online!



            Returns the result as an integer.



            Neil found that his Charcoal approach turned out to be lucky after some rearrangement.



            Pure arithmetic and comparison solution (61 bytes):



            lambda y,m,d:y%100*1000+30*m+m/2+(8<m<12)+~(0<y%4)*(2<m)+d-31





            share|improve this answer











            $endgroup$












            • $begingroup$
              Seems to be a day off for January and February?
              $endgroup$
              – Neil
              3 hours ago










            • $begingroup$
              @Neil Oh LOL I just noticed I was subtracting the extra day February doesn't have even when that month hasn't passed yet. EDIT: should be fixed.
              $endgroup$
              – Erik the Outgolfer
              3 hours ago











            • $begingroup$
              I ported my Charcoal solution, and then golfed it down to 57 bytes: y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33. (Sadly this rearrangement has the same byte count in Charcoal.)
              $endgroup$
              – Neil
              3 hours ago










            • $begingroup$
              @Neil LOL Charcoal thinking beats Python thinking 10/10 I guess. :D I'll add it and see what I can further do, if I can.
              $endgroup$
              – Erik the Outgolfer
              3 hours ago















            1












            $begingroup$


            Python 2, 63 61 57 bytes





            lambda y,m,d:y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33


            Try it online!



            Returns the result as an integer.



            Neil found that his Charcoal approach turned out to be lucky after some rearrangement.



            Pure arithmetic and comparison solution (61 bytes):



            lambda y,m,d:y%100*1000+30*m+m/2+(8<m<12)+~(0<y%4)*(2<m)+d-31





            share|improve this answer











            $endgroup$












            • $begingroup$
              Seems to be a day off for January and February?
              $endgroup$
              – Neil
              3 hours ago










            • $begingroup$
              @Neil Oh LOL I just noticed I was subtracting the extra day February doesn't have even when that month hasn't passed yet. EDIT: should be fixed.
              $endgroup$
              – Erik the Outgolfer
              3 hours ago











            • $begingroup$
              I ported my Charcoal solution, and then golfed it down to 57 bytes: y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33. (Sadly this rearrangement has the same byte count in Charcoal.)
              $endgroup$
              – Neil
              3 hours ago










            • $begingroup$
              @Neil LOL Charcoal thinking beats Python thinking 10/10 I guess. :D I'll add it and see what I can further do, if I can.
              $endgroup$
              – Erik the Outgolfer
              3 hours ago













            1












            1








            1





            $begingroup$


            Python 2, 63 61 57 bytes





            lambda y,m,d:y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33


            Try it online!



            Returns the result as an integer.



            Neil found that his Charcoal approach turned out to be lucky after some rearrangement.



            Pure arithmetic and comparison solution (61 bytes):



            lambda y,m,d:y%100*1000+30*m+m/2+(8<m<12)+~(0<y%4)*(2<m)+d-31





            share|improve this answer











            $endgroup$




            Python 2, 63 61 57 bytes





            lambda y,m,d:y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33


            Try it online!



            Returns the result as an integer.



            Neil found that his Charcoal approach turned out to be lucky after some rearrangement.



            Pure arithmetic and comparison solution (61 bytes):



            lambda y,m,d:y%100*1000+30*m+m/2+(8<m<12)+~(0<y%4)*(2<m)+d-31






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 3 hours ago

























            answered 6 hours ago









            Erik the OutgolferErik the Outgolfer

            34.4k4 gold badges30 silver badges108 bronze badges




            34.4k4 gold badges30 silver badges108 bronze badges











            • $begingroup$
              Seems to be a day off for January and February?
              $endgroup$
              – Neil
              3 hours ago










            • $begingroup$
              @Neil Oh LOL I just noticed I was subtracting the extra day February doesn't have even when that month hasn't passed yet. EDIT: should be fixed.
              $endgroup$
              – Erik the Outgolfer
              3 hours ago











            • $begingroup$
              I ported my Charcoal solution, and then golfed it down to 57 bytes: y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33. (Sadly this rearrangement has the same byte count in Charcoal.)
              $endgroup$
              – Neil
              3 hours ago










            • $begingroup$
              @Neil LOL Charcoal thinking beats Python thinking 10/10 I guess. :D I'll add it and see what I can further do, if I can.
              $endgroup$
              – Erik the Outgolfer
              3 hours ago
















            • $begingroup$
              Seems to be a day off for January and February?
              $endgroup$
              – Neil
              3 hours ago










            • $begingroup$
              @Neil Oh LOL I just noticed I was subtracting the extra day February doesn't have even when that month hasn't passed yet. EDIT: should be fixed.
              $endgroup$
              – Erik the Outgolfer
              3 hours ago











            • $begingroup$
              I ported my Charcoal solution, and then golfed it down to 57 bytes: y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33. (Sadly this rearrangement has the same byte count in Charcoal.)
              $endgroup$
              – Neil
              3 hours ago










            • $begingroup$
              @Neil LOL Charcoal thinking beats Python thinking 10/10 I guess. :D I'll add it and see what I can further do, if I can.
              $endgroup$
              – Erik the Outgolfer
              3 hours ago















            $begingroup$
            Seems to be a day off for January and February?
            $endgroup$
            – Neil
            3 hours ago




            $begingroup$
            Seems to be a day off for January and February?
            $endgroup$
            – Neil
            3 hours ago












            $begingroup$
            @Neil Oh LOL I just noticed I was subtracting the extra day February doesn't have even when that month hasn't passed yet. EDIT: should be fixed.
            $endgroup$
            – Erik the Outgolfer
            3 hours ago





            $begingroup$
            @Neil Oh LOL I just noticed I was subtracting the extra day February doesn't have even when that month hasn't passed yet. EDIT: should be fixed.
            $endgroup$
            – Erik the Outgolfer
            3 hours ago













            $begingroup$
            I ported my Charcoal solution, and then golfed it down to 57 bytes: y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33. (Sadly this rearrangement has the same byte count in Charcoal.)
            $endgroup$
            – Neil
            3 hours ago




            $begingroup$
            I ported my Charcoal solution, and then golfed it down to 57 bytes: y%100*1000+(153*m-2)/5+[m+1,1>y%4][2<m]+d-33. (Sadly this rearrangement has the same byte count in Charcoal.)
            $endgroup$
            – Neil
            3 hours ago












            $begingroup$
            @Neil LOL Charcoal thinking beats Python thinking 10/10 I guess. :D I'll add it and see what I can further do, if I can.
            $endgroup$
            – Erik the Outgolfer
            3 hours ago




            $begingroup$
            @Neil LOL Charcoal thinking beats Python thinking 10/10 I guess. :D I'll add it and see what I can further do, if I can.
            $endgroup$
            – Erik the Outgolfer
            3 hours ago











            1












            $begingroup$


            C# (Visual C# Interactive Compiler), 88 78 73 71 59 57 bytes





            a=>a[0]%100*1000+new DateTime(a[0],a[1],a[2]).DayOfYear-1


            Try it online!






            share|improve this answer











            $endgroup$

















              1












              $begingroup$


              C# (Visual C# Interactive Compiler), 88 78 73 71 59 57 bytes





              a=>a[0]%100*1000+new DateTime(a[0],a[1],a[2]).DayOfYear-1


              Try it online!






              share|improve this answer











              $endgroup$















                1












                1








                1





                $begingroup$


                C# (Visual C# Interactive Compiler), 88 78 73 71 59 57 bytes





                a=>a[0]%100*1000+new DateTime(a[0],a[1],a[2]).DayOfYear-1


                Try it online!






                share|improve this answer











                $endgroup$




                C# (Visual C# Interactive Compiler), 88 78 73 71 59 57 bytes





                a=>a[0]%100*1000+new DateTime(a[0],a[1],a[2]).DayOfYear-1


                Try it online!







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 3 hours ago

























                answered 7 hours ago









                Expired DataExpired Data

                1,6934 silver badges23 bronze badges




                1,6934 silver badges23 bronze badges





















                    1












                    $begingroup$


                    Python 3, 87 85 74 bytes





                    lambda y,m,d:sum([y*1000-2000029+28*m,3,y%4==0,3,2,3,2,3,3,2,3,2,3][:m])+d


                    Try it online!



                    This is using only numeric operations and comparisons.






                    share|improve this answer











                    $endgroup$

















                      1












                      $begingroup$


                      Python 3, 87 85 74 bytes





                      lambda y,m,d:sum([y*1000-2000029+28*m,3,y%4==0,3,2,3,2,3,3,2,3,2,3][:m])+d


                      Try it online!



                      This is using only numeric operations and comparisons.






                      share|improve this answer











                      $endgroup$















                        1












                        1








                        1





                        $begingroup$


                        Python 3, 87 85 74 bytes





                        lambda y,m,d:sum([y*1000-2000029+28*m,3,y%4==0,3,2,3,2,3,3,2,3,2,3][:m])+d


                        Try it online!



                        This is using only numeric operations and comparisons.






                        share|improve this answer











                        $endgroup$




                        Python 3, 87 85 74 bytes





                        lambda y,m,d:sum([y*1000-2000029+28*m,3,y%4==0,3,2,3,2,3,3,2,3,2,3][:m])+d


                        Try it online!



                        This is using only numeric operations and comparisons.







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited 47 mins ago

























                        answered 5 hours ago









                        DatDat

                        5341 gold badge3 silver badges15 bronze badges




                        5341 gold badge3 silver badges15 bronze badges





















                            0












                            $begingroup$


                            Ruby, 40 bytes





                            ->dTime.gm(*d).strftime('%y%j').to_i-1


                            Try it online!



                            So close to being a built-in format, but %j is 1-indexed.



                            In a happier coincidence, though, Tesco Time (.gm) is one character shorter than local time (.new).






                            share|improve this answer









                            $endgroup$

















                              0












                              $begingroup$


                              Ruby, 40 bytes





                              ->dTime.gm(*d).strftime('%y%j').to_i-1


                              Try it online!



                              So close to being a built-in format, but %j is 1-indexed.



                              In a happier coincidence, though, Tesco Time (.gm) is one character shorter than local time (.new).






                              share|improve this answer









                              $endgroup$















                                0












                                0








                                0





                                $begingroup$


                                Ruby, 40 bytes





                                ->dTime.gm(*d).strftime('%y%j').to_i-1


                                Try it online!



                                So close to being a built-in format, but %j is 1-indexed.



                                In a happier coincidence, though, Tesco Time (.gm) is one character shorter than local time (.new).






                                share|improve this answer









                                $endgroup$




                                Ruby, 40 bytes





                                ->dTime.gm(*d).strftime('%y%j').to_i-1


                                Try it online!



                                So close to being a built-in format, but %j is 1-indexed.



                                In a happier coincidence, though, Tesco Time (.gm) is one character shorter than local time (.new).







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered 7 hours ago









                                histocrathistocrat

                                19.5k4 gold badges32 silver badges74 bronze badges




                                19.5k4 gold badges32 silver badges74 bronze badges





















                                    0












                                    $begingroup$


                                    Charcoal, 33 bytes



                                    IΣ⟦×φ﹪θ¹⁰⁰⊖ζ÷⊕×¹⁵³⊖η⁵⎇›η²⊖⊖¬﹪θ⁴⊖η


                                    Try it online! Link is to verbose version of code. Try it online! Link includes test suite. I don't think Charcoal has any date functions, so here's a mathematical solution. Explanation:



                                     ×φ﹪θ¹⁰⁰ Year * 1000
                                    ⊖ζ Day - 1
                                    ÷⊕×¹⁵³⊖η⁵ Days in previous months
                                    ⎇›η² For months after Februrary
                                    ⊖⊖¬﹪θ⁴ Adjust for leap years else
                                    ⊖η Adjust for short Februrary
                                    Σ⟦ Take the sum
                                    I Cast to string for implicit print





                                    share|improve this answer









                                    $endgroup$

















                                      0












                                      $begingroup$


                                      Charcoal, 33 bytes



                                      IΣ⟦×φ﹪θ¹⁰⁰⊖ζ÷⊕×¹⁵³⊖η⁵⎇›η²⊖⊖¬﹪θ⁴⊖η


                                      Try it online! Link is to verbose version of code. Try it online! Link includes test suite. I don't think Charcoal has any date functions, so here's a mathematical solution. Explanation:



                                       ×φ﹪θ¹⁰⁰ Year * 1000
                                      ⊖ζ Day - 1
                                      ÷⊕×¹⁵³⊖η⁵ Days in previous months
                                      ⎇›η² For months after Februrary
                                      ⊖⊖¬﹪θ⁴ Adjust for leap years else
                                      ⊖η Adjust for short Februrary
                                      Σ⟦ Take the sum
                                      I Cast to string for implicit print





                                      share|improve this answer









                                      $endgroup$















                                        0












                                        0








                                        0





                                        $begingroup$


                                        Charcoal, 33 bytes



                                        IΣ⟦×φ﹪θ¹⁰⁰⊖ζ÷⊕×¹⁵³⊖η⁵⎇›η²⊖⊖¬﹪θ⁴⊖η


                                        Try it online! Link is to verbose version of code. Try it online! Link includes test suite. I don't think Charcoal has any date functions, so here's a mathematical solution. Explanation:



                                         ×φ﹪θ¹⁰⁰ Year * 1000
                                        ⊖ζ Day - 1
                                        ÷⊕×¹⁵³⊖η⁵ Days in previous months
                                        ⎇›η² For months after Februrary
                                        ⊖⊖¬﹪θ⁴ Adjust for leap years else
                                        ⊖η Adjust for short Februrary
                                        Σ⟦ Take the sum
                                        I Cast to string for implicit print





                                        share|improve this answer









                                        $endgroup$




                                        Charcoal, 33 bytes



                                        IΣ⟦×φ﹪θ¹⁰⁰⊖ζ÷⊕×¹⁵³⊖η⁵⎇›η²⊖⊖¬﹪θ⁴⊖η


                                        Try it online! Link is to verbose version of code. Try it online! Link includes test suite. I don't think Charcoal has any date functions, so here's a mathematical solution. Explanation:



                                         ×φ﹪θ¹⁰⁰ Year * 1000
                                        ⊖ζ Day - 1
                                        ÷⊕×¹⁵³⊖η⁵ Days in previous months
                                        ⎇›η² For months after Februrary
                                        ⊖⊖¬﹪θ⁴ Adjust for leap years else
                                        ⊖η Adjust for short Februrary
                                        Σ⟦ Take the sum
                                        I Cast to string for implicit print






                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered 3 hours ago









                                        NeilNeil

                                        85.9k8 gold badges46 silver badges183 bronze badges




                                        85.9k8 gold badges46 silver badges183 bronze badges





















                                            0












                                            $begingroup$

                                            JavaScript, 70 57 bytes



                                            (y,m,d,U=Date.UTC)=>y%100*1e3+(U(y,m-1,d)-U(y,0,1))/864e5


                                            Try it online!






                                            share|improve this answer











                                            $endgroup$












                                            • $begingroup$
                                              59 bytes?
                                              $endgroup$
                                              – Arnauld
                                              4 hours ago











                                            • $begingroup$
                                              @Arnauld y%100*1e3 works because they have the same precedence.
                                              $endgroup$
                                              – Neil
                                              4 hours ago










                                            • $begingroup$
                                              Heh, I was overcomplicating it by using string concatenation when simple arithmetic is all that was needed. Thanks @Arnauld and @Neil!
                                              $endgroup$
                                              – darrylyeo
                                              3 hours ago










                                            • $begingroup$
                                              @darrylyeo something in the back of my head said -2000 was 1 byte too many but %100 was far too obvious!
                                              $endgroup$
                                              – Expired Data
                                              2 hours ago















                                            0












                                            $begingroup$

                                            JavaScript, 70 57 bytes



                                            (y,m,d,U=Date.UTC)=>y%100*1e3+(U(y,m-1,d)-U(y,0,1))/864e5


                                            Try it online!






                                            share|improve this answer











                                            $endgroup$












                                            • $begingroup$
                                              59 bytes?
                                              $endgroup$
                                              – Arnauld
                                              4 hours ago











                                            • $begingroup$
                                              @Arnauld y%100*1e3 works because they have the same precedence.
                                              $endgroup$
                                              – Neil
                                              4 hours ago










                                            • $begingroup$
                                              Heh, I was overcomplicating it by using string concatenation when simple arithmetic is all that was needed. Thanks @Arnauld and @Neil!
                                              $endgroup$
                                              – darrylyeo
                                              3 hours ago










                                            • $begingroup$
                                              @darrylyeo something in the back of my head said -2000 was 1 byte too many but %100 was far too obvious!
                                              $endgroup$
                                              – Expired Data
                                              2 hours ago













                                            0












                                            0








                                            0





                                            $begingroup$

                                            JavaScript, 70 57 bytes



                                            (y,m,d,U=Date.UTC)=>y%100*1e3+(U(y,m-1,d)-U(y,0,1))/864e5


                                            Try it online!






                                            share|improve this answer











                                            $endgroup$



                                            JavaScript, 70 57 bytes



                                            (y,m,d,U=Date.UTC)=>y%100*1e3+(U(y,m-1,d)-U(y,0,1))/864e5


                                            Try it online!







                                            share|improve this answer














                                            share|improve this answer



                                            share|improve this answer








                                            edited 3 hours ago

























                                            answered 5 hours ago









                                            darrylyeodarrylyeo

                                            5,43410 silver badges34 bronze badges




                                            5,43410 silver badges34 bronze badges











                                            • $begingroup$
                                              59 bytes?
                                              $endgroup$
                                              – Arnauld
                                              4 hours ago











                                            • $begingroup$
                                              @Arnauld y%100*1e3 works because they have the same precedence.
                                              $endgroup$
                                              – Neil
                                              4 hours ago










                                            • $begingroup$
                                              Heh, I was overcomplicating it by using string concatenation when simple arithmetic is all that was needed. Thanks @Arnauld and @Neil!
                                              $endgroup$
                                              – darrylyeo
                                              3 hours ago










                                            • $begingroup$
                                              @darrylyeo something in the back of my head said -2000 was 1 byte too many but %100 was far too obvious!
                                              $endgroup$
                                              – Expired Data
                                              2 hours ago
















                                            • $begingroup$
                                              59 bytes?
                                              $endgroup$
                                              – Arnauld
                                              4 hours ago











                                            • $begingroup$
                                              @Arnauld y%100*1e3 works because they have the same precedence.
                                              $endgroup$
                                              – Neil
                                              4 hours ago










                                            • $begingroup$
                                              Heh, I was overcomplicating it by using string concatenation when simple arithmetic is all that was needed. Thanks @Arnauld and @Neil!
                                              $endgroup$
                                              – darrylyeo
                                              3 hours ago










                                            • $begingroup$
                                              @darrylyeo something in the back of my head said -2000 was 1 byte too many but %100 was far too obvious!
                                              $endgroup$
                                              – Expired Data
                                              2 hours ago















                                            $begingroup$
                                            59 bytes?
                                            $endgroup$
                                            – Arnauld
                                            4 hours ago





                                            $begingroup$
                                            59 bytes?
                                            $endgroup$
                                            – Arnauld
                                            4 hours ago













                                            $begingroup$
                                            @Arnauld y%100*1e3 works because they have the same precedence.
                                            $endgroup$
                                            – Neil
                                            4 hours ago




                                            $begingroup$
                                            @Arnauld y%100*1e3 works because they have the same precedence.
                                            $endgroup$
                                            – Neil
                                            4 hours ago












                                            $begingroup$
                                            Heh, I was overcomplicating it by using string concatenation when simple arithmetic is all that was needed. Thanks @Arnauld and @Neil!
                                            $endgroup$
                                            – darrylyeo
                                            3 hours ago




                                            $begingroup$
                                            Heh, I was overcomplicating it by using string concatenation when simple arithmetic is all that was needed. Thanks @Arnauld and @Neil!
                                            $endgroup$
                                            – darrylyeo
                                            3 hours ago












                                            $begingroup$
                                            @darrylyeo something in the back of my head said -2000 was 1 byte too many but %100 was far too obvious!
                                            $endgroup$
                                            – Expired Data
                                            2 hours ago




                                            $begingroup$
                                            @darrylyeo something in the back of my head said -2000 was 1 byte too many but %100 was far too obvious!
                                            $endgroup$
                                            – Expired Data
                                            2 hours ago











                                            0












                                            $begingroup$


                                            Japt, 23 bytes



                                            Takes input as 3 individual strings, assuming that's allowed.



                                            ¤+@ÐUTX ŶÐN Å}as ùT3 É


                                            Try it



                                            Very unhappy with this (there must be a better way to get the day of the year!) but it's been a long day. A port of darrylyeo's JS solution would be 2 bytes shorter but, for some reason, despite Japt being JavaScript, floating point inaccuracies abound.






                                            share|improve this answer









                                            $endgroup$

















                                              0












                                              $begingroup$


                                              Japt, 23 bytes



                                              Takes input as 3 individual strings, assuming that's allowed.



                                              ¤+@ÐUTX ŶÐN Å}as ùT3 É


                                              Try it



                                              Very unhappy with this (there must be a better way to get the day of the year!) but it's been a long day. A port of darrylyeo's JS solution would be 2 bytes shorter but, for some reason, despite Japt being JavaScript, floating point inaccuracies abound.






                                              share|improve this answer









                                              $endgroup$















                                                0












                                                0








                                                0





                                                $begingroup$


                                                Japt, 23 bytes



                                                Takes input as 3 individual strings, assuming that's allowed.



                                                ¤+@ÐUTX ŶÐN Å}as ùT3 É


                                                Try it



                                                Very unhappy with this (there must be a better way to get the day of the year!) but it's been a long day. A port of darrylyeo's JS solution would be 2 bytes shorter but, for some reason, despite Japt being JavaScript, floating point inaccuracies abound.






                                                share|improve this answer









                                                $endgroup$




                                                Japt, 23 bytes



                                                Takes input as 3 individual strings, assuming that's allowed.



                                                ¤+@ÐUTX ŶÐN Å}as ùT3 É


                                                Try it



                                                Very unhappy with this (there must be a better way to get the day of the year!) but it's been a long day. A port of darrylyeo's JS solution would be 2 bytes shorter but, for some reason, despite Japt being JavaScript, floating point inaccuracies abound.







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered 1 hour ago









                                                ShaggyShaggy

                                                20.1k3 gold badges20 silver badges68 bronze badges




                                                20.1k3 gold badges20 silver badges68 bronze badges



























                                                    draft saved

                                                    draft discarded
















































                                                    If this is an answer to a challenge…



                                                    • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                                                    • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                                                      Explanations of your answer make it more interesting to read and are very much encouraged.


                                                    • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.


                                                    More generally…



                                                    • …Please make sure to answer the question and provide sufficient detail.


                                                    • …Avoid asking for help, clarification or responding to other answers (use comments instead).




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function ()
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f187723%2ftescos-burger-relish-best-before-end-date-number%23new-answer', 'question_page');

                                                    );

                                                    Post as a guest















                                                    Required, but never shown





















































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown

































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown







                                                    Popular posts from this blog

                                                    Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                                                    Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                                                    199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單