Timezone dropdown in form

I am using WP forms and want to have a dropdown menu where users can select their timezone. I found a list that I could hardcode into the dropdown but I read somewhere that this would be a bad idea because of daylight savings time. Not sure if that is the case.

Anyway, if anyone has some suggestions for this I would really appreciate it. Not sure if it is possible also to automatically detect the users timezone and store it in hidden field. This would be a better user experience.

Topic timezones forms Wordpress

Category Web


If you want to give users to select a timezone then you can render a select field and the options could be fetched using wp_timezone_choice function.

For automatically selecting a timezone, you might want to use the browser's geolocation detection feature, which would be a less preferred solution though.


You may have to use smart tag {date format="m/d/Y"}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.