How to store time (mm:ss.s) in bubble database?

Hello everyone,

I’m developing a fitness mobile app. I’m trying to store time values and do some operations on it. Like, add 20 secs or subtract 10 secs. Time should be displayed as mm:ss.s

The only data type available in Bubble database is “date”.

Any Idea how to deal with that?

1 Like

@AliFarahat @levon @emmanuel
Any Idea how to deal with time form (mm:ss.s) in bubble database?

Dates ARE times. I’ve written a lot about this and you might want to read this post reply from me:

Note that in addition to dates there are date ranges and date intervals in Bubble and these may be helpful to you. Consult the reference sections about those data types.

2 Likes

@keith Thanks I’ll check it out.

The way I dealt with this in the past it to set it to the start of Unix time while changing the timezone to UTC 0

So change the day, month, year, hour, sec to 00:00:00 UTC on 1 January 1970

After that add your time in seconds. And format it to display only the hours, minutes and second

Make sure you stick to that timezone. If you display the date in another time zone then it will show wrong.

You can also try a decimal notation then.

Read this

2 Likes

Thanks @AliFarahat