Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Inline date script 4 u 2 use freely

    General Discussion
    3
    4
    157
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jeffreyrb03-gmail
      JaecadeJnight Mod Helper last edited by

      43e1fc71-0a7e-43ef-abd4-99856c1f918d-image.png

      This gives today’s date, in a format suitable for databases. For today this returned “02/24/2025”.

      I’ll break it up into parts:

      1. Start with 2 join blocks, and put (current [year v]) at the far end.
        blocks (2).png
      2. Then, in those two spaces that say “apple”, you’ll place ternary operators (the if else blocks but as reporter blocks) that check for both the month and day of month, if they’re just one number, then to put a 0 before them since you can’t just have “1” in the date, instead “01”, and if they’re already something like “23” then there’s no need to add a 0 before it as “023” is not a day of the month or a month. There is also a workaround that I use that may confuse you, which is me adding “/” in odd spots in a way you usually wouldn’t use when making a date. That’s because the editor would mess up the 0 because when 02 = 2, and make what I was doing with the 0s useless.
      3. Now I’ll get into it, as Linus Torvalds said, “Talk is cheap. Show me the code.”
        In the first “apple”, put this:
        742e5626-cb12-47ef-aee3-a41d866fd1a4-image.png
        This is for the month, since the month goes first in this date format. It makes sure to add “/” after it to follow the date format (mm/dd/yyyy), and to cirumvent being turned into a number and instead turn into a string (so 02 doesnt become 2).
      4. In the second “apple”, put this:
        00284327-a919-4018-bd3b-d7f8c4cef424-image.png
        This gives the day of the month, known as the date in this context (a bit confusing, since there’s two date related things called date lol). It does the same thing done for the month so that it gets 0 if needed and has “/” at the end.
      5. Now you’re done! You don’t need to do that with the year since the year is always going to be 4 digits for a while.

      This is an example of where you would need this in a database:
      59d48fc6-2ba8-4852-8f4c-9a4edff2c19d-image.png
      If you need help with it working don’t be afraid to ask questions

      #LLJW
      <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

      The_True_Odst 1 Reply Last reply Reply Quote 0
      • The_True_Odst
        The True ODST Best Forum Helpers @jeffreyrb03-gmail last edited by

        @jeffreyrb03-gmail Shouldn’t this be under tutorials?

        ODST: Orbital Drop Ship Trooper
        (Halo Reference)

        jeffreyrb03-gmail c. 2 Replies Last reply Reply Quote 1
        • jeffreyrb03-gmail
          JaecadeJnight Mod Helper @The_True_Odst last edited by

          @011830-0a42ef84 I dont have permissions to post there

          #LLJW
          <span style="color:white;background-image:linear-gradient(to right, lightblue, navy)">My name is Jeff</span>

          1 Reply Last reply Reply Quote 0
          • c.
            Cαƚƚყ Mod Helper @The_True_Odst last edited by

            @011830-0a42ef84
            You’re kind of right.
            Yes, it should, only 1 problem.
            You can’t

            Official Forums Moderator

            1 Reply Last reply Reply Quote 1
            • First post
              Last post