Extract time from date column

I have two columns with start date and end date. I want to display information on a course on a website as follows (via Integromat/Make ):
Start date - end date
Start time - end time

I already have the start date and end date nicely formatted. The respective columns are only set to display the date. But I could select the option to show the time (so: in the start column, also the start time, in the end column, also the finish time).
Bildschirm­foto 2023-01-04 um 17.03.22

I could achieve this in Integromat, but first wanted to see if there is a formula to allow me to simply extract the time to a separate text column which I could then pass on to Integromat?

Would this do the trick?
image

Thanks Ralf, that seems to work.

The only issue now is the formatting. I need it to display in the 24-hr format. See screenshot for current result:
Bildschirm­foto 2023-01-05 um 11.30.03

Fair point. I wasn’t thinking of that.

Quick fix: Add an if/ifs to account for the possibility of a start at :00.

Hi ralf,

OK, I achieved this using 3 columns: 1 ifs formula to extract/format the hour, another ifs formula to extract/format the minutes (in 5-minute blocks) and another to concatenate the two into the format I want.

This means that, to get the following: 18:00 - 21:00, I need 5 columns - 2 columns for hours, 2 columns for minutes and 1 column to concatenate.

The screenshot shows the ifs for minutes (blocks of 5 minutes) and the concatenate for 1 block of time
Bildschirm­foto 2023-01-05 um 16.07.21

Surely there is an easier way?

Hi @webdienste.

I don’t get the reason for the stepping, but you could also do something like this…
Did I get your intention right?

if(
  hour({PrĂĽfung}) < 10,
  "0" & hour({PrĂĽfung}),
  hour({PrĂĽfung})
) 
& ":" &
if(
  (minute({PrĂĽfung}) % 5) = 0,
    if(
      minute({PrĂĽfung}) < 10,
      "0" & minute({PrĂĽfung}),
      minute({PrĂĽfung})
    )
)

grafik

2 Likes

Hi AkDk7

That was brilliant, that is exactly what I want. And so much simpler than what I had!!!

The stepping was to make the “ifs” for the minutes easier to handle. Most of the start and end times are either 00 or 30 anyway as those are the only 2 times than can be chosen.

1 Like

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