doushiposong30622 2010-01-25 22:34
浏览 292
已采纳

使用每个国家/地区的可用时区填充时区下拉列表?

I just noticed something really nice on the Google Analytics signup page for adding a new domain. First you pick a country them you pick your timezone. Instead of showing a huge Timezone list though they populate the timezone list with only timezones that are available for the country you have selected. I think this is a great idea to make picking a timezone easiar for some users.

So I would like to do this with jQuery since most my other javascript is using jquery already. Has anyone seen any existing jquery script that can do this for me? Or possibly how I can figure out what timezones are in each country?

  • 写回答

2条回答 默认 最新

  • douwei4370 2010-01-25 22:49
    关注

    Can't help with jQuery but for how to figure out what timezones are in each country, you can use DateTimeZone::listIdentifiers() with DateTimeZone::PER_COUNTRY as first argument and the ISO 3166-1 compatible country code as second argument, e.g.

    DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, 'GB');
    

    Note: PHP 5.3 is required.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥60 pb数据库修改或者求完整pb库存系统,需为pb自带数据库
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路