douchen7555 2010-04-24 19:08
浏览 69
已采纳

Drupal时区信息

In my drupal installation I can get the offset from UTC in seconds to the timezone I specified in the admin panel using

variable_get('date_default_timezone', 0)

However, now that we have daylight-saving-time, the time I get is always off by one hour. Is there a way to retrieve the actual timezone string from Drupal, as "Europe/Berlin" for example?

The reason is, that I have to use this with Zend Framework's Zend_Date, but Drupal does not set the PHP default timezone, as

echo date_default_timezone_get();

gives me System/Localtime.

  • 写回答

2条回答 默认 最新

  • dongqi4085 2010-09-23 09:20
    关注

    I found the solution:

    date_default_timezone is only set, when custom user timezones are disabled in the admin panel! Make sure that you check off that option.

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

报告相同问题?

悬赏问题

  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services