admin管理员组

文章数量:1122826

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.

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.

Share Improve this question asked Dec 31, 2019 at 8:03 user10980228user10980228 1691 silver badge14 bronze badges 1
  • you can use the function timezone_identifiers_list to have the timezone list – Kaperto Commented Dec 31, 2019 at 8:57
Add a comment  | 

2 Answers 2

Reset to default 0

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

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.

本文标签: Timezone dropdown in form