Forum Academy Marketplace Showcase Pricing Features

Storing Date/Time as ISO 8601

This question seems pretty basic, but I’m trying to store some JSON data from Acuity Scheduling as a date/time field to then re-format it how I want. The issue is that Bubble doesn’t like how the data is coming in. It seems like Bubble should be able to pick this up, since it’s formatted as an ISO 8601 date.

Have any of you all dealt with this? If so, how did you handle it? I’m considering storing the time and date variables separately but that then leaves me with the issue of storing the time zone as a text field which probably will give me trouble converting too.

How did you go with this? Is the data coming in through an API? One possible workaround is to receive it as text, then send it through another API to get converted to a number unix datetime UTC with milliseconds, then receive it back as date.

I realized that it’s actually possible to store it as a date this way. It wasn’t as intuitive as I was expecting to get this to happen though. Took a little playing with.

Hey guys. @mishav @david

Working on something relevant and need some ideas on how to handle datetime logic.

  1. I have a date with time stored as UNIX epoch f.ex. (1480300842) and want to have a custom event that WHEN the current things date is passed. queries my external API again and creates a new thing / updates

  2. Alternatively I can get the bubble format of date for when it will expire.

Thanks in advance.

According to the docs, scheduling a custom event doesn’t work if the user hasn’t got the page running, so it’s a client-side initiation.

I’d say your best option is “Schedule API Workflow” so it is initiated server-side. It needs a scheduled date as a parameter. The advantage of this is it uses the login of the user who created the schedule.

EDIT - the scheduled date accepts seconds or Bubble’s date (ms).

Is there something specific you were looking for?

Client side initiation is not a problem since it`s all related to an active session and the user being online watching a video stream.

What I want to achieve is: When there is less than (60 minutes) left, then a workflow will query the third party API (A node.js service I have built) via api connector requesting a new 24 hour token.

You got a point that I could run a workflow for all tokens in the system but it would generate unnecessary tokens, as it is only needed for active users, and possibly in the future the tokens may have a shorter lifetime, for example 20 minutes.

Also, if I provide the datetime in a non-epoch format, how should I let the node.js webservice return it so bubble can read hours/minutes etc.