Change number format to date

Hello everyone! Hoping you are all doing well, I have a series of columns that extract certain specific days of the month, but I would like it to be in date format.

Has anyone done something like this before? where I can display in date format 05/10/2024

Can you share more on the logic here? Your “Hoy” column is a date, and if you want “DÍA CINCO” to always be the 5th date of the month, it can just be Hoy + 4.

1 Like

Look, what happens is that I can’t apply “today + 4”, because if for example today is October 2, but if I do today + 4 then it would give me the 6th, and I want it to take the 5th, 15th, 28th and 30th of the current month. I don’t know if I make myself clear? I mean, basically I want to get the dates of the 5th, 15th, 28th and 30th of the current month, but if I do the sum then it wouldn’t work because the days go by and then it would no longer show 5 but another day.

You could construct the date yourself.

To get the current month use the formula month(Date)

Then use template columns to add the 5th 15th 28th and 30th to it.

Use this in a math column with your starting date.

Date-Day(Date)+5

3 Likes

It could be a very good option, but the thing is that I want this to be for all months, that is, when it is November I also want to have the dates of November 5, 15, 28 and 30. With what you tell me your Date-Day(Date)+5 the thing is that this works when I have a start date, but here there is no start date, since I want to take from the current month the 5th, 15th, 28th and 30th.

Could you be a little more specific about the assembly? I understand the idea but I haven’t been able to do it yet.

Today (Now) can be a start date. It will calculate dynamically based on the current year and month of today. Any date can be used as long as it’s an actual date. Your screenshots indicate that you have some sort of base date to start from.

My solution is really no different than yours, but a whole lot simpler. You are already grabbing year and month from a date and trying to append a day number, which is fine, but doesn’t lead to a real date. My solution does the same thing but results in a real date. If your Hoy column is supposed to represent today, then you can get rid of it and do it all in one column. Use my formula and replace date with the ‘Now’ special value.

If that’s not what you want, you will need to explain more. Are you trying to calculate dates for just the current month? For all months in the future? All months in the past?

2 Likes

You are so right Jeff! I have already understood your point of view, and it is exactly what I was looking for, I already understood that what you are doing is subtracting the date from the date and then adding the day that I want to extract in this case 5,15,28 and 30. The truth is that it worked. Another question, do you know if it is possible to show these dates in a choice element? That is, all the dates 5,15,28,30 to show them in a choice element? I understand that the choice works for data in columns.

If you want to use them as choices, then I would create a 4 row table. In each row have a column with the day number you want. Then add the math column. You will have 4 rows with each unique date in each row. You should only need two columns. One for day number and one for the math with a reacement value to use that day number.

Build your choices down instead of across. The choice component requires data in rows.

PS. Be aware that February will bite you if you are attempting to use 30.

3 Likes

Thank you very much Jeff for your support, I have achieved the goal I was looking for!

1 Like