ibrahimyaacob
ibrahimyaacob4w ago

how to get client timezone

my app is sending email action (convex action + react email), I've rendered a date time using date.now() on the email body and when the email is sent to the client, they got the server date time, how do i compensate this ? I'm guessing that I'll need to get the request's time zone, but how ?
4 Replies
Convex Bot
Convex Bot4w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
jamalsoueidan
jamalsoueidan4w ago
Just send the date from the client, add it to the form data.
erquhart
erquhart4w ago
A lot of my convex functions have an arg for timezone. Eventually going to set up a custom useQuery/Mutation/Action hooks and custom functions so every convex function gets the user's timezone on the ctx.
ibrahimyaacob
ibrahimyaacobOP4w ago
@erquhart , @jamalsoueidan thanks for the hint

Did you find this page helpful?