# Compare a future date if \< 5:00PM

**URL:** https://community.glideapps.com/t/compare-a-future-date-if-5-00pm/28301
**Category:** Ask for Help
**Created:** [June 24, 2021, 5:01am UTC](https://community.glideapps.com/t/compare-a-future-date-if-5-00pm/28301 "2021-06-24T05:01:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Rogelio](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rogelio/32/1054_2.png) [@Rogelio](https://community.glideapps.com/u/Rogelio)
#### Post date: [June 24, 2021, 5:01am UTC](https://community.glideapps.com/t/compare-a-future-date-if-5-00pm/28301/1 "2021-06-24T05:01:50Z")

</div>

Hoping this can be achieved via Glide Tables. I have the following columns:

> `lastBookingTime` is a date in the future (Jul 10th, 2.30PM)

> `lastBooking+1hr` is the date above + 1 hour

I am trying to do a simple IF-ELSE as follows;

IF `lastBooking+1hr` \< 5:00 PM (Jul 10th, 5.00PM)

**How do I set 5:00 PM to July 10th a date in the future to do the comparison?**

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/8/484214204cdd2ac9a4002709ecdd9bfe6b8cc64c.png)

---

<div class="post-metadata">

### Author: ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)
#### Post date: [June 24, 2021, 5:26am UTC](https://community.glideapps.com/t/compare-a-future-date-if-5-00pm/28301/2 "2021-06-24T05:26:38Z")

</div>

I think you can use math column to add hours using decimals,  
because if 1 is a day, then 1 hour is a twenty-fourth of a day.  
Try, i’m not in front my pc.

---

<div class="post-metadata">

### Author: ![Rogelio](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rogelio/32/1054_2.png) [@Rogelio](https://community.glideapps.com/u/Rogelio)
#### Post date: [June 24, 2021, 5:38am UTC](https://community.glideapps.com/t/compare-a-future-date-if-5-00pm/28301/3 "2021-06-24T05:38:35Z")

</div>

I get that…the question is more, how do I set a date/Time of `Jul 10th, 2:30PM` to be `Jul 10th, 5:00PM`

all the dates are dynamic, I want to set 5:00PM to all of them

---

<div class="post-metadata">

### Author: ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)
#### Post date: [June 24, 2021, 6:07am UTC](https://community.glideapps.com/t/compare-a-future-date-if-5-00pm/28301/4 "2021-06-24T06:07:01Z")

</div>

Ok, so if I understand, for example if the date/time is Jul 11th, 1:15PM the new date must be anyway Jul 11th, 5:00 PM ?

---

<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: [June 24, 2021, 6:10am UTC](https://community.glideapps.com/t/compare-a-future-date-if-5-00pm/28301/5 "2021-06-24T06:10:13Z")

</div>

This is adapted from something that @ThinhDinh gave me recently. It could possibly be simplified…

```auto
Date-HOUR(Date)/24-MINUTE(Date)/1440-SECOND(Date)/86400+(17/24)

```

 ![Screen Shot 2021-06-24 at 2.08.28 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/0/70e6c6158c9b2c241af339787cdeb1442c9eb9d0.png)

The first part of the formula finds midnight on the date in question, and then we add 17 hours (17/24) to get 5pm.

---

<div class="post-metadata">

### Author: ![Rogelio](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rogelio/32/1054_2.png) [@Rogelio](https://community.glideapps.com/u/Rogelio)
#### Post date: [June 24, 2021, 6:44am UTC](https://community.glideapps.com/t/compare-a-future-date-if-5-00pm/28301/7 "2021-06-24T06:44:02Z")

</div>

that worked! - Thanks Darren!

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/f/df21ba613aad58c6c3e938127617ec3a08bf9351.png)

---

<div class="post-metadata">

### Author: ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)
#### Post date: [January 17, 2024, 4:51pm UTC](https://community.glideapps.com/t/compare-a-future-date-if-5-00pm/28301/8 "2024-01-17T16:51:42Z")

</div>


