0

Hello I need to return timezones, when I select a country from a dropdown list.

Thank you!

Example

<select name='country' class='country'>
<option value='UK'>Ukraine</option>
<option value='RU'>Russian</option>
</select>

If choose UK ->alert(+2.0) If choose RU ->alert(+4.0)

Jack Bonneman
  • 1,821
  • 18
  • 24
user3338412
  • 1
  • 1
  • 2

1 Answers1

0

To find timezone you can use DateTimeZone::listIdentifiers

Example, for Ukraine:

var_dump(DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, "UK"));

So write onChange event using javasript and use PHP to get time zone.

sergio
  • 5,210
  • 7
  • 24
  • 46