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条)

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型