An update to this very old post – This method has been working faithfully for me for years, however I have noticed that every now and then it “doesn’t work”.
Turns out, it’s due to the way the “Current date/time” function natively works in Bubble. When you load a page, it gives the current date and time… however, if you keep the page open for 5 minutes, the current date/time is still what it was when you loaded the page initially.
This can lead to an issue where this worked… then suddenly “doesn’t work” (“hmm, the data is still stale… what gives!?”).
So, the new, free, 5 minute solution, that has proven rock solid for me is the following:
- Download the “Current date/time” plugin
- Place the plugin anywhere on the page you’re working on.
- Reference the new plugin vs. the native “current date/time” in Bubble.
OLD *using Bubbles native “current date/time”:
This ensures that no matter how long a page has been opened, every time you fire off another API call, the “current date/time” is absolutely the current date/time, thus ensuring fresh data with every call.