Inline date script 4 u 2 use freely
-
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:
- Start with 2 join blocks, and put (current [year v]) at the far end.
- 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.
- Now I’ll get into it, as Linus Torvalds said, “Talk is cheap. Show me the code.”
In the first “apple”, put this:
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). - In the second “apple”, put this:
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. - 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:
If you need help with it working don’t be afraid to ask questions - Start with 2 join blocks, and put (current [year v]) at the far end.
-
@jeffreyrb03-gmail Shouldn’t this be under tutorials?
-
@011830-0a42ef84 I dont have permissions to post there