Half hour time zones missing

后端 未结 3 1866
北海茫月
北海茫月 2021-01-20 02:34

In PHP I am using DateTimeZone::listIdentifiers() to get a list of time zones for user selection. This seems to be working fine, but missing from this list are

3条回答
  •  -上瘾入骨i
    2021-01-20 02:54

    Just guessing here, but it looks like the default $what parameter is DateTimeZone::ALL, and you want to use identifiers that only exist now for backwards compatibility - so you should use DateTimeZone::ALL_WITH_BC:

    print_r(DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC));
    

    Note that the manual does say not to use them.

    In the case of Iran, you could replace it with the Asia/Tehran time zone for example.

提交回复
热议问题