# Displaying hours and minute remaining today

**URL:** <https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449>\
**Category:** Ask for Help\
**Created:** [December 5, 2022, 10:16pm UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449 "2022-12-05T22:16:37Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/martin_b/32/74360_2.png) [@Martin\_B](https://community.glideapps.com/u/Martin_B)\
**Post date:** [December 5, 2022, 10:16pm UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/1 "2022-12-05T22:16:37Z")

</div>

Hello,

I think the title and my screenshots say it all…  
-How to display hours and minute remaining between two dates?  
-how to set up the progress bar (current progress= now; max= end of the day)?

HELP 🙂 please

Have a nice night

 ![Screenshot 2022-12-05 at 23.13.21](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/9/395767a852ed48057edd81d7882b5cc0824cb48c.png)  
 ![Screenshot 2022-12-05 at 23.11.52](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/3/e30426974e92825a23881da340d3a8c847d490c8.png)  
 ![Screenshot 2022-12-05 at 23.17.16](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/6/b6c816244c2dc02f141de61e58452ec617055dfc.jpeg)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [December 5, 2022, 10:44pm UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/2 "2022-12-05T22:44:41Z")

</div>

I would convert it to a percentage, or some kind of easy number. If you calculating the number of minutes between now and the end of the day, then you can divide that by the number of minutes in a workday.

For example: let’s say there are 8 hours in a workday (480 minutes). If there are two hours left in a day, then that’s 120 minutes.  
120/480 = 0.25 or 25%.

Set the min on the progress bar to 0 and the max to 1. At the beginning of the day, you’ll have 1 or greater than 1, and by the end of the day, you’ll have 0 or less than zero.

If you want to take out some math, set the max to 480 and get rid of the division. Just set the current value to the number of minutes different between now and the end time.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [December 5, 2022, 10:59pm UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/3 "2022-12-05T22:59:27Z")

</div>

If you are asking about getting a properly formatted date column for your end date and time, then you might be able to get away with setting your column that contains 23:30 to a date type column instead of a text column. Keep in mind that this method will set the day to the nearest date that contains that time. So after 23:30, the date difference may be negative until now is closer to 23:30 of the next day.

---

<div class="post-metadata">

**Author:** ![Martin\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/martin_b/32/74360_2.png) [@Martin\_B](https://community.glideapps.com/u/Martin_B)\
**Post date:** [December 6, 2022, 1:10am UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/4 "2022-12-06T01:10:45Z")

</div>

Thanks Jeff 🙏  
Well copied for the progress bar.

But yes im also stuck at the first step lol:

Get time difference between NOW and END of the day (set by user on preferences screen).

I get this weird number: -298,123,20  
Instead of what i want: 17 (17minutes between NOW and END of day)

Maybe im using wrong computed column? Or this number can be transformed in minutes somehow lol.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 6, 2022, 1:25am UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/5 "2022-12-06T01:25:55Z")

</div>

> [@Martin\_B](#):
>
> I get this weird number: -298,123,20  
> Instead of what i want: 17 (17minutes between NOW and END of day)

It would be useful if you showed us how you got that result (ie. a screen shot).

To get the difference between two datetime values in minutes, you can use the following math formula:

```auto
Trunc((EOD - Now) * 1440)

```

 ![Screen Shot 2022-12-06 at 9.25.00 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/c/ec16fd1821587ffbd74bddf1f8dd41d4b1cd5f38.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [December 6, 2022, 1:37am UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/6 "2022-12-06T01:37:23Z")

</div>

It seems that you are trying to use the template column as a date to calculate your time difference. The problem, is that the template column is just text. It’s not a valid date, even though it may look like it.

If you change your user enteres time column to a date type column, then you should be able to use that in your date difference column, or in a math column like @Darren_Murphy has shown. Either should work.

Most importantly, get rid of the template column because you don’t need it, and it wouldn’t work for anything anyway.

---

<div class="post-metadata">

**Author:** ![Martin\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/martin_b/32/74360_2.png) [@Martin\_B](https://community.glideapps.com/u/Martin_B)\
**Post date:** [December 6, 2022, 2:56am UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/7 "2022-12-06T02:56:40Z")

</div>

Thank you guys !  
Will try asap and let you know if i managed to level up lol…

(I did provide a screenshot of my column “date difference” that gets me this number)

---

<div class="post-metadata">

**Author:** ![Martin\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/martin_b/32/74360_2.png) [@Martin\_B](https://community.glideapps.com/u/Martin_B)\
**Post date:** [December 7, 2022, 2:34pm UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/8 "2022-12-07T14:34:40Z")

</div>

Hello,

Thanks to both of you, most of the work is done.No surprise.

Just: my user will need to set the end of the day as a time? for always.  
Im talking here about UI.

in user profile page he/she will set : end of the day.

But i want him to deal ONLY with a time **visually**.  
the choice or dat/time component should show:  
19:00  
and not 07/12:22 19:00

(that explain a bit my try earlier with template column etc…)

Thanks

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 7, 2022, 2:42pm UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/9 "2022-12-07T14:42:51Z")

</div>

> [@Martin\_B](#):
>
> Just: my user will need to set the end of the day as a time? for always.  
> Im talking here about UI.

Yes, that would work best.

What if they could select from a pre-generated list of times in a choice component - would that work?  
What you could do is use a Helper Table with two columns. One would contain a list of human readable times, something like “5pm, 5:30pm, 6pm, etc”, and the second column could contain the corresponding datetime values. The values in the second column could be auto generated using a bit of date math. So your choice component could _display_ the values in the first column, and _write_ the values from the second column.

Would that work?

---

<div class="post-metadata">

**Author:** ![Martin\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/martin_b/32/74360_2.png) [@Martin\_B](https://community.glideapps.com/u/Martin_B)\
**Post date:** [December 7, 2022, 7:49pm UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/10 "2022-12-07T19:49:21Z")

</div>

Genius idea!

Inside the maths column(the value of the choice component) what would be the magic formula please?

Today+ ?

As We need to display the computed **current** day, with the time set by the user.

——————

Im thinking now… of an option?  
I try tom to find step 4 lol

1/End time text colum: from Choice component to set a time value inside. (Choices from a List of fix time values as Darren said)

3/Template column ( maths current day column + time value text

4/ ???

5/ proper date/time column (constructed)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 8, 2022, 1:08am UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/11 "2022-12-08T01:08:48Z")

</div>

Let me make an example for you. What would be the time range you would want (eg 4pm min to 7pm max), and what intervals (eg. 15min, 30 min)?

---

<div class="post-metadata">

**Author:** ![Martin\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/martin_b/32/74360_2.png) [@Martin\_B](https://community.glideapps.com/u/Martin_B)\
**Post date:** [December 8, 2022, 1:20am UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/12 "2022-12-08T01:20:24Z")

</div>

Thanks Darren…  
A good template is worth a thousand of words lol

Interval of 30 then. Its faster for you?  
once understood i can modify later…

The possible end date range:  
10am to 12pm.

(Some people like me do deep work on short period of time… like from 6am to 10 am)

Have a nice day!

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [December 8, 2022, 1:39am UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/13 "2022-12-08T01:39:19Z")

</div>

oops, too late I already made the video. But I explained how it’s done, so you should be able to adjust:

Formulas that I used:

Min time:

```auto
Now
- Hour(Now)/24
- Minute(Now)/1440
- Second(Now)/86400
+ 15/24

```

For your case, you would change the last line to 10/24

Actual time:

```auto
Min + 15/1440 * Index

```

To get 30 min intervals, you would change that to 30/1440

---

<div class="post-metadata">

**Author:** ![Martin\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/martin_b/32/74360_2.png) [@Martin\_B](https://community.glideapps.com/u/Martin_B)\
**Post date:** [December 8, 2022, 3:12pm UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/14 "2022-12-08T15:12:07Z")

</div>

Double thanks:

1/ working perfectly

2/i understood (not only copy) so new skills for me - **no price on that.**

Bonus: i know how to find and display a row number! ( no direct fct for that in glide table - yet)  
I think it will help me with that:

> [@List reorder while seeing the title](https://community.glideapps.com/t/list-reorder-while-seeing-the-title/55522):
>
> Hello team, As we don’t have a DRAG N DROP reorder list feature yet… may i ask if is it planned? @david See the video to check the solution i found yet… Does anyone have something better? As you see the limit here with the default number… if the row are too far from each other, or equal, it’s annoying to tap for hours sweat_smile[https://www.loom.com/share/48d04a6af3eb4540a47672e9acb65569](https://www.loom.com/share/48d04a6af3eb4540a47672e9acb65569)

And some screenshots for the ones that will get the same challenge we had here.

 ![Screenshot 2022-12-08 at 15.55.32](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/1/111f18fea47eb67b153f0a077f0e954b349c3907.png)  
 ![Screenshot 2022-12-08 at 15.14.56](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/7/87ad01891649ab2da96f586343630261f72d6f9f.jpeg)

 ![Screenshot 2022-12-08 at 16.10.53](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/d/6daa9a9049a7b0f944d497eed6448f27d2d5e7d2.jpeg)  
 ![Screenshot 2022-12-08 at 16.10.37](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/4/d4b7e016297622a0133877a9b6156edb9902b4c8.png)  
 ![Screenshot 2022-12-08 at 16.10.30](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/9/d907042d7c0673f5eddd7229fe04f7dffea3fe39.png)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [December 9, 2022, 3:12pm UTC](https://community.glideapps.com/t/displaying-hours-and-minute-remaining-today/55449/15 "2022-12-09T15:12:14Z")

</div>

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