Time Only Picker?

Hello, I’m trying to save the time only, or just select time only with the date/time picker. I’ve tried using the air date/time picker plugin, but I’m unable to save the time to the database. Any advice?

What exactly is your use case? Because Bubble saves time in Unix, which is the number of seconds from January 1st, 1970. This means that you cannot use a date/time picker and the date data field to just save a time without the month, day, and year. I’ve had to build a system that saves dates that are just month and year and it was a very challenging situation. Dates can be messy. What exactly are you trying to do in the front end and on the back end?

Hey @omer3012345 this is a common bubble limitation. There are 2 main ways to save a time or use a time picker. One is to save the date and then just extract out the hour and minute when needed using the :extract function. You can do something such as Date rounded down to day +hours (Date:extract hour) + minutes (Date:extract minute)

The other way is a little more confusing but would require setting up a Time option set with each time broken out into the increments you need. You can then add additional variables such as the display and time in minutes (The amount of minutes from midnight to the desired time)

You can then use this option set and when needed take a Date rounded down to day and + minutes = the option set time in minutes.

Front end, user needs to select the time only. Backend, it can be whatever date, just the time needs to be the one they picked. It’s basically to set the users availability hours. The start time they are available, and the end time they are available

@arensbpa

This topic was automatically closed after 70 days. New replies are no longer allowed.