You’ll really need to use Luxon for this (check out the Luxon docs - or there might be a public Bubble Luxon available) - and you need to know the original timezones the Dates were defined in.
If you know (i.e . you have stored in the Database) the original Timezones used for defining each Date, it’s simple…
You can just create a new Date object in UTC by extracting the values from the original Date with the Original timezone. Then output that as a Bubble Date object and save it in your database.
If you don’t know the original timezone then you can only really ‘guess’ the initial intended Date - but rounding to the nearest UTC midnight (as you suggest) might be good enough for most purposes - it will be incorrect if any of the timezones involved are more than 12 hours difference from UTC (which some are, but you may not be working with those), and Daylight savings changes will probably also cause some errors - but it’s all you can do if you don’t know the original timezones used.
1 Like