Is there any way to get the client's time zone in the nextjs service, (not a fetch request)?
Unanswered
Air Penguin posted this in #help-forum
Is there any way to get the client's time zone in the nextjs service, (not a fetch request)? I want to get the user's time zone, but I don't want to have to ask another service to parse the ip in the header.
4 Replies
@Anay-208 | Ping on replies this seems like a xyproblem
https://xyproblem.info/
What is your usecase for getting time?
I'm sorry for not making it clear, my scenario is that when the user visits the website, different pages need to be displayed according to the user's timezone
@Air Penguin Is there any way to get the client's time zone in the nextjs service, (not a fetch request)? I want to get the user's time zone, but I don't want to have to ask another service to parse the ip in the header.
no, unfortunately. you can get the tz in client side and use client side data fetching.
on the server you can only guess the tz from the ip address as you already said in the question.
on the server you can only guess the tz from the ip address as you already said in the question.
well, Looks like I'll have to try something else. Thank you very much