Bubble rounds down seconds when exporting dates/time fields

Hi.
I have created an app that records the date and time of a button press. I believe it stores the result in the table as a epoch date (e.g. 45264.37708) but when I view the table it shows it in dd/mm/yy hh:mm:ss format - which is fine as the seconds are still displayed accurately - I’m happy wiht eitehr. I then output the field to a csv do do some calucations but it exports the field as text with to round the seconds down to 00 seconds every time - e.g. 15/11/2023 14:02:22 is rounded down to 15/11/2023 14:02:00 in the csv
How do I do an export from bubble to get the full date and time with seconds not rounded down? It’s really important as we are measuring the difference between button presses in minutes and seconds.
Thanks

Sorry if this has already been answered but I cant seem to find the answer.

2 Likes

Why not just do the calculations in Bubble?

Thanks Adam. I didn’t’ realise it was possible. I have three fields - {Queue Start Time}, {Place Order Time} and {Collect Order Time} and I want to calculate the queue time ({Place Order Time} - {Queue Start Time}) and the wait time for their order ({Collect Order Time} - {Place Order Time}) in seconds. Is that quite easy to do? Can I sue bubble like excel then?
Thanks

Hi Adam. I’ve just realised what you mean - do the calculations in the app as the data is entered / buttons clicked. The problem I have is we have already collected loads of data and only realised the issue when we came to analyse it. It showed all ok in the app with dd/mm/yyyy hh:mm:ss in the data table in bubble but seems to truncate to just dd/mm/yyyy hh:mm as a text field. Is there any way of getting it to export the full field or the epoch date?

No, I mean do the calculations in Bubble, wherever/whenever you need them…

I’ not sure I see the point in exporting the data to do calculations outside of Bubble (what’s the point of using Bubble in that case)?

But yes, of course you can do calculation in Bubble. you can do exactly what you’ve stated (i.e. Place order time - Queue start time, and Collect Order Time - Place Order Time)

Is that quite easy to do?

Yes, it’s as simple as I’ve described above.

Is there any way of getting it to export the full field or the epoch date?

The only way to do this with Vanilla Bubble would be to add a text field to the datatype and store either the UNIX timestamp, or the date formatted in some other way, and use that on your csv export.

Otherwise, there are plugins available that offer much more control on the data you can export on a CSV, so you can format the date however you like, or even do the calculations before exporting it to CSV (but then what’s the point of exporting it in that case?).