# I have a given time but need to subtract 20 minutes

**URL:** <https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641>\
**Category:** Ask for Help\
**Created:** [January 29, 2025, 6:41pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641 "2025-01-29T18:41:39Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrianWyne](https://avatars.discourse-cdn.com/v4/letter/b/8491ac/32.png) [@BrianWyne](https://community.glideapps.com/u/BrianWyne)\
**Post date:** [January 29, 2025, 6:41pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/1 "2025-01-29T18:41:39Z")

</div>

In my table I have a date/time column that is Time only. I need to subtract 20 minutes from the that 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:** [January 29, 2025, 6:55pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/2 "2025-01-29T18:55:18Z")

</div>

You can use a math column to subtract `0.0138888` from a datetime.

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [January 29, 2025, 6:59pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/3 "2025-01-29T18:59:13Z")

</div>

You should use 20/1440 to not loose decimals

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [January 29, 2025, 6:59pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/4 "2025-01-29T18:59:39Z")

</div>

`Date - 20/1440`

---

<div class="post-metadata">

**Author:** ![BrianWyne](https://avatars.discourse-cdn.com/v4/letter/b/8491ac/32.png) [@BrianWyne](https://community.glideapps.com/u/BrianWyne)\
**Post date:** [January 29, 2025, 7:58pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/5 "2025-01-29T19:58:37Z")

</div>

I need the result to be a Date/time format. I am combining the PickDate and Time columns using a Template then Math column. I need an additional column with a time that is 20 minutes earlier. For example I need the time at 8:02 am and a time at 7:42 am. The date part will not change and the range for the original time is between 8:00am and 4:00pm each day.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/8/68dd8193a0fa00bbeab20386b51530136c723d6c.png)

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [January 29, 2025, 8:03pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/6 "2025-01-29T20:03:10Z")

</div>

Use a math column with `Date - 20/1440`.  
Set Date to your date column. It will be a new column.

---

<div class="post-metadata">

**Author:** ![BrianWyne](https://avatars.discourse-cdn.com/v4/letter/b/8491ac/32.png) [@BrianWyne](https://community.glideapps.com/u/BrianWyne)\
**Post date:** [January 29, 2025, 8:10pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/7 "2025-01-29T20:10:40Z")

</div>

I don’t get any results.

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

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [January 29, 2025, 8:13pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/8 "2025-01-29T20:13:12Z")

</div>

Try to add a format datetime column and inject DateTime column. Choose medium date & time / no seconds. Then use that new column in the math column.

Is it still giving nothing?

---

<div class="post-metadata">

**Author:** ![BrianWyne](https://avatars.discourse-cdn.com/v4/letter/b/8491ac/32.png) [@BrianWyne](https://community.glideapps.com/u/BrianWyne)\
**Post date:** [January 29, 2025, 8:23pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/9 "2025-01-29T20:23:38Z")

</div>

The original data set lists the date and time seperately. I combine them with a template then convert the template into a date/time object using a math column (DateTime). It doesn’t seem to like doing any additional math against the DateTime column.

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

---

<div class="post-metadata">

**Author:** ![BrianWyne](https://avatars.discourse-cdn.com/v4/letter/b/8491ac/32.png) [@BrianWyne](https://community.glideapps.com/u/BrianWyne)\
**Post date:** [January 29, 2025, 8:41pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/10 "2025-01-29T20:41:39Z")

</div>

Format Date with the DateTime column doesn’t produce anything

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/2/b2e81cacda17d70e937c409db2264658eca446ed.png)

---

<div class="post-metadata">

**Author:** ![MaximeBaker](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/maximebaker/32/80877_2.png) [@MaximeBaker](https://community.glideapps.com/u/MaximeBaker)\
**Post date:** [January 29, 2025, 9:42pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/11 "2025-01-29T21:42:53Z")

</div>

The format you gave isn’t valid. Try to set `D T`

---

<div class="post-metadata">

**Author:** ![BrianWyne](https://avatars.discourse-cdn.com/v4/letter/b/8491ac/32.png) [@BrianWyne](https://community.glideapps.com/u/BrianWyne)\
**Post date:** [January 29, 2025, 10:02pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/12 "2025-01-29T22:02:04Z")

</div>

DateTime is already a date format. I have tried converting DateTime to an int using math column then subtracting different values but converting it back to a date produces inconsistent results.

Year(Date) \* 100000000

- Month(Date) \* 1000000
- Day(Date) \* 10000
- Hour(Date) \* 100
- Minute(Date)

---

<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:** [January 29, 2025, 10:19pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/13 "2025-01-29T22:19:11Z")

</div>

Why do you have separate date and time columns instead of a single date column filled with a datetime picker? That way you would already have date and time in the same column without having to merge them which is a whole different challenge altogether.

---

<div class="post-metadata">

**Author:** ![BrianWyne](https://avatars.discourse-cdn.com/v4/letter/b/8491ac/32.png) [@BrianWyne](https://community.glideapps.com/u/BrianWyne)\
**Post date:** [January 29, 2025, 10:26pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/14 "2025-01-29T22:26:19Z")

</div>

The data comes from an excel spreadsheet. The time is assigned to the user. I join the date and time using a template then a math column to convert it to a date. I then relate this table to the user’s table.

---

<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:** [January 29, 2025, 10:43pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/15 "2025-01-29T22:43:02Z")

</div>

I think that makes sense. I think I would do a couple things differently.

- Instead of trying to combine the date and time with a template column, I would go straight to the math column to pull year/month/day from the date column and hour/minute from the time column.
- Then I think you should be using the Date from Text column. Format date tries to convert a date too the specified format as opposed to from that format.

Another alternative would be to use the template column, and then go straight to the Date from Text column without doing any math.

---

<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:** [February 5, 2025, 10:43pm UTC](https://community.glideapps.com/t/i-have-a-given-time-but-need-to-subtract-20-minutes/79641/16 "2025-02-05T22:43:26Z")

</div>

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