How to extract time from a date value?

I’m a bit stuck!

I have two time values (in Google Sheets they appear as time, 07:00, plus they can be a value (0.x)

  • this is opening and closing hours in utc

I have a computed column in my lookup sheet that uses XC for getting UTC - as a date time value (date + time)

I’m stuck on doing my if-then-else on just the time part of the utc / now.

Any help, please? Thanks!

I got it fixed… by remembering that a time value alone in Glide is computed as today’s date + time. So I did actually have the right values - as long as I used a math column for the time.

1 Like

I made a script on the same principle as DateUTC but with only the time.
Only, it is necessarily a string value in return.

for YC


But if you have a date & time you can use a Math column and only display the time !!!

The issue was not displaying, but handing the datetime values with just the decimal place value for the time itself.

What is the decimal value of a date?
an example !!

But this also exists with a Math column
use x-trunc (x)

After if you want the decimal part of a number you can use

return p1- parseInt (p1)

example if P1 = 10.95
return 0.95

1 Like

Date time values are integers for the days, and decimal place for the time (ie 1200 midday is 0.5).