# How to display time difference (date - date) as HH:MM?

**URL:** <https://forum.bubble.io/t/how-to-display-time-difference-date-date-as-hh-mm/379555>\
**Category:** Need help\
**Created:** [August 26, 2025, 8:22pm UTC](https://forum.bubble.io/t/how-to-display-time-difference-date-date-as-hh-mm/379555 "2025-08-26T20:22:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davi.simao](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@davi.simao](https://forum.bubble.io/u/davi.simao)\
**Post date:** [August 26, 2025, 8:22pm UTC](https://forum.bubble.io/t/how-to-display-time-difference-date-date-as-hh-mm/379555/1 "2025-08-26T20:22:36Z")

</div>

### **Description:**

Hi everyone,

I’m having trouble working with a variable of type **“evaluates to a date”**.

What I’m trying to do:

- Take the current date/time and subtract another date.

- I want to display the result on the front end as **HH:MM**.

The issue:

- Bubble only lets me format the result as **days, hours, minutes, or seconds** , but not directly in the `HH:MM` format.

- I’m currently using a text element to display the value.

**Question:**  
What’s the correct way to format a date difference and display it as `HH:MM` in Bubble?

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/8/9/89ee3163ac45e112cc1b4fc8b14719ba3b16e32d.png)

---

<div class="post-metadata">

**Author:** ![mario11](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mario11/32/232274_2.png) [@mario11](https://forum.bubble.io/u/mario11)\
**Post date:** [August 26, 2025, 8:26pm UTC](https://forum.bubble.io/t/how-to-display-time-difference-date-date-as-hh-mm/379555/2 "2025-08-26T20:26:14Z")

</div>

Here’s how you can achieve this in Bubble:

**The Challenge:**

When you subtract dates in Bubble, you get a date interval (measured in milliseconds), but the built-in formatting options don’t directly give you HH:MM format.

**The Solution:**

You’ll need to use mathematical operators to convert the date interval into hours and minutes:

1. **Calculate Hours:** Use `Date difference :formatted as hours` to get the total hours
2. **Calculate Minutes:** Use `Date difference :formatted as minutes` and then use the modulo operator (%) with 60 to get remaining minutes
3. **Format as Text:** Combine these in a text element like: `Hours & ":" & Minutes`

**Example Expression:**

In your text element, you could use something like:

```auto
Current date/time - Other date :formatted as hours & ":" & (Current date/time - Other date :formatted as minutes % 60)

```

**Important Note:**

Once you format a date using `:formatted as`, it becomes text and can no longer be manipulated as a date. That’s why we use the mathematical approach instead.

This approach gives you the precise HH:MM format you’re looking for while working within Bubble’s date handling system!

---

<div class="post-metadata">

**Author:** ![davi.simao](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@davi.simao](https://forum.bubble.io/u/davi.simao)\
**Post date:** [August 26, 2025, 8:49pm UTC](https://forum.bubble.io/t/how-to-display-time-difference-date-date-as-hh-mm/379555/3 "2025-08-26T20:49:04Z")

</div>

tku men!

I have used this logic:

((Data A - Data B):formatted as minutes) ÷ 60 :floor & “:” & ((Data A - Data B):formatted as minutes mod 60):formatted as 00

---

<div class="post-metadata">

**Author:** ![mario11](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mario11/32/232274_2.png) [@mario11](https://forum.bubble.io/u/mario11)\
**Post date:** [August 26, 2025, 8:51pm UTC](https://forum.bubble.io/t/how-to-display-time-difference-date-date-as-hh-mm/379555/4 "2025-08-26T20:51:29Z")

</div>

Sounds good 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [November 4, 2025, 8:23pm UTC](https://forum.bubble.io/t/how-to-display-time-difference-date-date-as-hh-mm/379555/5 "2025-11-04T20:23:03Z")

</div>

Closed on November 4, 2025, 8:23pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
