Date operations are not producing the correct results

Hello Glide community. It turns out that I want to fill a date field of type date&time with two fields. One is a date-only field, for example, 26/09/2025, and the other field is of type time only, for example, 09:00. To fill the third field with these two fields, I am using a flow and in the action “set column values” I place the following formula: date + (time/24). To simplify the formula I have placed the direct result 0.375. In the date field the formula looks like this: date + 0.375. The result I get when executing the flow is 26/09/2025 07:00. Now I do a second test changing just the time field to a different value, for example, date + 0.675, and the result is the same. The result does not change, it still comes out as 26/09/2025 07:00. When executing the flow I have a message that informs me whether the flow executes correctly or if it goes the other way and tells me if the flow failed, which does not happen; it always goes through normal execution. Thanks a lot for your comments. Raul

hi. You can try converting like this:

YEAR(D)*100000000 + MONTH(D)*1000000 + DAY(D)*10000 + HOUR(T)*100 + MINUTE(T)

with D as date input and T as time input.

Then use a Text to Date column with format of yyyyLLddHHmm and the inverse of your timezone (because of an apparent bug, mine is utc-4 but utc+4 gives me the correct result).

Just want to mention that the formatting for a date type column is only visual. The underlying value still contains a full date and time, so by your description, you have a date type column formatted to only display a date and another date type column formatted to only display a time, but in reality the underlying values for both columns contain both a date and a time. Just want to make you aware that there is no such thing as a date only column or a time only column. They are all date type columns that contain both dates and times. The formatting just controls how that date and time are displayed on the front end.

Also, you can’t just put a formula into a column using the Set Column action and expect the correct result. It’s taking the literal text ‘@date’+0.675 and writing it to the date column. It has no concept of what you are trying to do, so it write the date plus the garbage behind it and tries it’s best to convert it to a date and time. Maybe your original date column contains the underlying time of 7:00 or it’s just trying to convert your formula to something and defaults to 7:00. Set Column does not do any sort of math. Only a Math column can use math formulas.

1 Like

I got the impression that he was currently using text entry components, math columns to format it and a button to perform the set column value at the end of the input series. :thinking:

With that method, shouldn’t you be able to override any underlying date?

Ok i going to apply your comments. I will write you later. Thank you.

1 Like

Ok i going to apply your comments. I will write you later. Thank you

Let’s see if I had no idea what I’m doing, the flow would fail and wouldn’t give me results. I clearly said it gives me a result. In a flow, you can create formulas just like in Excel. You have no idea what I write. Look ‘@date’+0.675 that means a formula that says: (date)+0.675. Where date is the field that only has the format dd/mm/yyyy and 0.675 means 16 hours and 12 minutes. In the action set values, you can create formulas in the resulting date field by adding a date field plus another time field. These two fields are implicitly complete dates, and I acknowledge there was a conceptual error, for which I appreciate the suggestion to take into account. Thanks

look in excel i did like this:

26/09/2025 + 1 = 27/09/2025 00:00

and the example that i wrote above was:

26/09/2025 + 0.675 = 26/09/2025 16:20 in excel ===> this is the result that glide fail

Please check in excel this example and create one flow like this. Where is the big error?

Good to hear! This is an excel formula if you still wanted it. This output can be used in Glide’s native text to date column with the format I mentioned before.

=YEAR(A1)*100000000 + MONTH(A1)*1000000 + DAY(A1)*10000 + HOUR(B1)*100 + MINUTE(B1)

Thank you Sekayi. I going to try your comments, later.

1 Like

The problem was solved in a very simple way.

The observation made by Jeff is important because when using data types that are only time still remain as dates, and that is why it gave incorrect results. But Glide has a very powerful data type is Math field. With this data type, you can create as many formulas as in Excel, and that is what I did. The formula that solved this problem was TRUNC(HOUR(hora)/24,4). When you handle dates including time, these data types help validate what the user is entering. This is the case for scheduling appointments. This concept is vital and I was needing that everything is working very well because i need it for a client. Thank you very much everybody for your observations.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.