Skip to content

Easter egg2 min read

How to Show Different Text Based on the Time of Day in Webflow

Learn how to display different text based on the time of day in Webflow: dynamic greetings and day-specific messages.

In this tutorial, Sandro, co-founder of Gemeos Webflow agency, shows you how to display different text depending on the time of day in Webflow.

Example

Based on your local time

Loading...

...

Time rangeMessageID to use
5am - 12pm☀️ Good morningtime-greeting
12pm - 2pm🍽️ Enjoy your mealtime-greeting
6pm - 10pm🌙 Good eveningtime-greeting
Based on the dayHappy Monday, Happy Friday...day-greeting

1. Add an ID to your text in Webflow

On your Text Block: custom attribute Name = id, Value = time-greeting.

(function() {
  function getGreeting() {
    var h = new Date().getHours();
    if (h >= 5 && h < 12) return '☀️ Good morning';
    if (h >= 12 && h < 14) return '🍽️ Enjoy your meal';
    if (h >= 14 && h < 18) return '🌤️ Good afternoon';
    if (h >= 18 && h < 22) return '🌙 Good evening';
    return '⭐ Good night';
  }
  var el = document.getElementById('time-greeting');
  if (el) el.textContent = getGreeting();

  var dayEl = document.getElementById('day-greeting');
  var days = ['Happy Sunday', 'Happy Monday!', 'Happy Tuesday', 'Happy midweek',
    'Almost the weekend 🙌', 'Happy Friday!', 'Happy Saturday ☀️'];
  if (dayEl) dayEl.textContent = days[new Date().getDay()];
})();

Conclusion

A small personalization detail that creates an immediate connection with the visitor.

Published on May 19, 2026

Sandro DA SILVA

Growth Marketer, Webflow expert, and jack-of-all-trades. Sandro handles commercial operations, ensures projects run smoothly, and addresses marketing-related issues (SEO, Tracking, Copywriting, etc).

You're going to working with us, guaranteed

Ready to launch your business?

get a quote

Let’s f*****G GO !!