How can I detect user's timezone?
I have a custom post type in wordpress. I am pulling various data from remote server with API and adding it as custom fields to this post type. Among them is date and time whose Timezone is Turkey. I'm saving this date as a custom field.
But I want to implement Time Zone based on visitor's location while showing date in front-end.
When I researched I realized that we cannot detect client-side Time Zone easily with PHP. I've looked at some recommendations using cookies and JavaScript, but the client's first visit will show an incorrect date and in subsequent requests, the correct timezone will be visible thanks to the cookie. Naturally, this is undesirable.
Finally, I can't think of a solution other than using 3rd party services.
Do you think there is a way to get the correct timezone of the client on the server side with PHP?
Topic timezones custom-field Wordpress
Category Web