MisMatch Timezones
Hey, I need help configuring my Edge Functions so they use the user’s local timezone instead of UTC for my scheduled reminders (24h and 1h before a booking).
Right now everything is firing based on UTC+00, which breaks the logic when the provider or client is in another timezone. I need a proper way to:
Detect the user’s timezone (stored in DB or passed in request — either works).
Run the Edge Function’s time comparisons using that timezone, not the default UTC of Deno.
Make sure the scheduled reminders (24h / 1h before) are calculated correctly without relying on messy manual offsets.
9 Replies
I think what you might want is a combination of cron job + database function that then calls and edge function
and it passes in those time values that are 1 hours/24 hour before
store everything in UTC
Could you elaborate please? or if you are free I would be glad to talk a bit more

Oh database function? It can't be handled with supabase edge function?
this is sample i code i have lying about (might have to change it for your own case)
personally it would make sense to do store the user timezon in the database and doing cron job -> database function -> edge function seems better than doing cron job ->edge function ->database function
because edge functions might timeout in a query or something
it makes more sense to me to do all the heavy data operations first and then pass that into an edge function to send out emails
Oh so every X minutes, cron runs a DB function that finds booking where local time is either 24h or 1h before the booking, groups them, and calls my edge function with the payload
which will be simple -send mail- if true
yeah that is what i would do (others might have better ideas though)
Only you have answered for now, what means its the best answer
Thank you ibrahim,
no worries!