# Display a text based on current time of day

**URL:** <https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887>\
**Category:** Need help\
**Created:** [September 16, 2020, 10:00pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887 "2020-09-16T22:00:07Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudibakken](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rudibakken/32/173531_2.png) [@rudibakken](https://forum.bubble.io/u/rudibakken)\
**Post date:** [September 16, 2020, 10:00pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/1 "2020-09-16T22:00:07Z")

</div>

Hi, I would like to display a ‘Good morning @current users name’ at a certain time of the day, and that it automatically changes to ‘Good afternoon…’ lets say 12:00 (European time format)

I know how to connect the logged in users name to the text message, but I can’t get the conditions to work - to make that message change depending on the time of the day. I’m using the “current date/time:extract: hour \<12 and current date/time:extract: hour \>6” condition. Then I choose what text to display. Then I add a new condition with different time etc… But this doesn’t seem to work for me.

Any helpful souls out there?

---

<div class="post-metadata">

**Author:** ![ben4](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ben4/32/20434_2.png) [@ben4](https://forum.bubble.io/u/ben4)\
**Post date:** [September 16, 2020, 10:41pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/2 "2020-09-16T22:41:18Z")

</div>

Hey, take a look at my loom. I have done what you are asking. 🙂

https://www.loom.com/embed/219934c9781141679bc3b65b99df4b05

Let me know if you have any questions.

Benjamin

---

<div class="post-metadata">

**Author:** ![rudibakken](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rudibakken/32/173531_2.png) [@rudibakken](https://forum.bubble.io/u/rudibakken)\
**Post date:** [September 17, 2020, 9:52am UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/3 "2020-09-17T09:52:31Z")

</div>

Thank you so much Benjamin, that worked!! 🙂

---

<div class="post-metadata">

**Author:** ![sudsy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/sudsy/32/114637_2.png) [@sudsy](https://forum.bubble.io/u/sudsy)\
**Post date:** [September 17, 2020, 10:43am UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/4 "2020-09-17T10:43:55Z")

</div>

Nice, @ben4.

I wonder if it could be simplified a bit by eliminating the custom state and referencing the **Current date/time** directly in the Conditional.

-Steve

---

<div class="post-metadata">

**Author:** ![ben4](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ben4/32/20434_2.png) [@ben4](https://forum.bubble.io/u/ben4)\
**Post date:** [September 17, 2020, 5:20pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/5 "2020-09-17T17:20:34Z")

</div>

You could do that.

There was a reason I added the set state, but I don’t remember what it is anymore. (I have a brain injury and forget almost everything from anytime in the past)

---

<div class="post-metadata">

**Author:** ![boston85719](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/boston85719/32/77286_2.png) [@boston85719](https://forum.bubble.io/u/boston85719)\
**Post date:** [September 17, 2020, 5:26pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/6 "2020-09-17T17:26:04Z")

</div>

Use the notes on any element, workflow, page etc. to write down things to remind you in the future what they were for and what they maybe interact with…don’t forget to sign your name at the bottom so you know it is a note from your former self

---

<div class="post-metadata">

**Author:** ![ben4](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ben4/32/20434_2.png) [@ben4](https://forum.bubble.io/u/ben4)\
**Post date:** [September 17, 2020, 5:27pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/7 "2020-09-17T17:27:26Z")

</div>

@boston85719 Haha thank you, I have always wanted to use the note function, but for something I am not using, I wouldn’t have taken notes anyway.

---

<div class="post-metadata">

**Author:** ![sudsy](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/sudsy/32/114637_2.png) [@sudsy](https://forum.bubble.io/u/sudsy)\
**Post date:** [September 17, 2020, 5:41pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/8 "2020-09-17T17:41:10Z")

</div>

> [@ben4](#):
>
> I have a brain injury and forget almost everything from anytime in the past

I do that all the time as well, and I don’t have a brain injury. 🤪

(That’s just a feeble attempt at humor. I don’t mean to make light of your situation. 😉 By the way, there are some [very promising developments](https://www.luther.ai/) with regard to leveraging AI to aid memory.)

-Steve

* * *

### > **Premium Bubble Plug-Ins** > > [![](https://tech-tonic.co/storage/repo/icon-sudsy-page-bg.png)](https://tech-tonic.co/products/sudsy-page "Sudsy Page")[![](https://tech-tonic.co/storage/repo/icon-upload-buddy-bg.png)](https://tech-tonic.co/products/upload-buddy "Upload Buddy")[![](https://tech-tonic.co/storage/repo/icon-marker-mate-bg.png)](https://tech-tonic.co/products/marker-mate "Marker Mate")

---

<div class="post-metadata">

**Author:** ![ben4](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ben4/32/20434_2.png) [@ben4](https://forum.bubble.io/u/ben4)\
**Post date:** [September 17, 2020, 5:43pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/9 "2020-09-17T17:43:43Z")

</div>

@sudsy Not to worry, it was funny. In fact, its is said to me very often. Haha. I’ll take a look at the link shortly. Thank you!

---

<div class="post-metadata">

**Author:** ![rudibakken](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rudibakken/32/173531_2.png) [@rudibakken](https://forum.bubble.io/u/rudibakken)\
**Post date:** [September 19, 2020, 9:57pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/10 "2020-09-19T21:57:00Z")

</div>

Hi again Benjamin,

I want to display a ‘Good night’ text between 23:00 and 04:00, but for some reason that text isn’t displayed. All the other conditions works just as in your video, but I believe the reason for that last condition not being showed has something to do with the hour format. I’m in Norway using the 24 hour format, and the problem only occurs when the time span in the condition passes midnight. Do you (or anyone else reading this) have any idea on how to solve this?

---

<div class="post-metadata">

**Author:** ![ben4](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ben4/32/20434_2.png) [@ben4](https://forum.bubble.io/u/ben4)\
**Post date:** [September 19, 2020, 10:08pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/11 "2020-09-19T22:08:09Z")

</div>

can you send a screenshot of the conditions tab you are talking about? Thank you.

---

<div class="post-metadata">

**Author:** ![rudibakken](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rudibakken/32/173531_2.png) [@rudibakken](https://forum.bubble.io/u/rudibakken)\
**Post date:** [September 20, 2020, 12:04am UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/12 "2020-09-20T00:04:29Z")

</div>

Here is a screenshot

 ![Skjermbilde 2020-09-20 kl. 02.03.11](https://us1.discourse-cdn.com/bubble/original/3X/a/3/a35b09e63f8d349d1d24bb7941f6d9b8a0a82190.png)

---

<div class="post-metadata">

**Author:** ![ben4](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ben4/32/20434_2.png) [@ben4](https://forum.bubble.io/u/ben4)\
**Post date:** [September 20, 2020, 2:53am UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/13 "2020-09-20T02:53:02Z")

</div>

Hey Again,

When you extract an hour from the date and time you dont get the same loop as you would with a clock. When you say greater than 23, that only means 24. After 24 it goes back down to 00:00. and 00:00 is not greater than 23.

Take a look at this loom to see the solution: [https://www.loom.com/share/227d2f2c91604b14b10b1c1f85ceacb7](https://www.loom.com/share/227d2f2c91604b14b10b1c1f85ceacb7)

Benjamin

---

<div class="post-metadata">

**Author:** ![rudibakken](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rudibakken/32/173531_2.png) [@rudibakken](https://forum.bubble.io/u/rudibakken)\
**Post date:** [September 20, 2020, 10:53am UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/14 "2020-09-20T10:53:24Z")

</div>

I’ll have a go at it now. What you explain makes perfectly sense. I’ll let you know if it’s work.  
Again, thank you so much!!

---

<div class="post-metadata">

**Author:** ![rudibakken](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rudibakken/32/173531_2.png) [@rudibakken](https://forum.bubble.io/u/rudibakken)\
**Post date:** [September 20, 2020, 11:19am UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/15 "2020-09-20T11:19:35Z")

</div>

It worked!! 🙂

---

<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 25, 2020, 10:00pm UTC](https://forum.bubble.io/t/display-a-text-based-on-current-time-of-day/111887/16 "2020-11-25T22:00:12Z")

</div>

Closed on November 25, 2020, 10:00pm UTC

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