如何在DST期间以正确的时间进行Plone显示事件?

问题描述

| 我正在编写一个采用iCalendar的Plone产品,将其引入并创建Plone Event类型。我已经将其全部工作正常,除了在半年的日期中,时间戳减少了一个小时。 我的iCalendar供稿将这些传递为UTC时间戳: DTSTART; VALUE = DATE:20110812T130000Z应该在美国/纽约时区的上午9点 DTEND; VALUE = DATE:20110812T160000Z应该是美国/纽约时区的12点 那些工作正常。这些不会: DTSTART; VALUE = DATE:20111225T175525Z应该是1:55 pm,但显示为12:55 pm DTEND; VALUE = DATE:20111225T215525Z应该是5:55 pm,但显示为4:55 pm 从生成iCalendar提要的数据库,到iCalendar生成器,再到存储在Zope中的实际值,一切都正确。但是Plone在事件详细信息页面上显示了不正确的本地时间。 我已经尝试在扩展程序中设置\“ TZ America / New_York \”,我已经尝试在Zope服务器上设置系统时钟,以查看转换是否会神奇地发生在“返回EST之后”。没运气。 这里有一些示例可以说明问题: 在EDT中发生的正确显示事件:
 BEGIN:VEVENT
DESCRIPTION:Flyer Fridays give you the opportunity to hear from professors
  in Communication Sciences & Disorders\\,Education\\,Management\\,Nursing\\,Physical Therapy\\,Occupational Therapy or Visual & Performing Arts.  \\n
 \\nFaculty sessions begin at 9:15am (PLEASE CHOOSE ONE)\\,followed by a 10a
 m campus tour and an 11am Freshmen information session.  After the day\'s e
 vents\\,you\'re invited to join the Admissions staff for lunch.
DTEND;VALUE=DATE:20110812T160000Z
DTSTART;VALUE=DATE:20110812T130000Z
LOCATION:Nazareth College
SUMMARY:Flyer Friday - Management Info Session
UID:ug-flyerfriday-164
END:VEVENT
并且,如何将其存储在Zope中:
>>> app.Plone.events[\'ug-flyerfriday-164\'].startDate
DateTime(\'2011/08/12 13:00:00 GMT+0\')
在EST中发生的显示错误的事件:
BEGIN:VEVENT
DESCRIPTION:Fun with TZINFO Flyer Fridays give you the opportunity to hear
  from professors in Communication Sciences & Disorders\\,Manag
 ement\\,Occupational Therapy or Visual & Perf
 orming Arts.  \\n\\nFaculty sessions begin at 9:15am (PLEASE CHOOSE ONE)\\,f
 ollowed by a 10am campus tour and an 11am Freshmen information session.  A
 fter the day\'s events\\,you\'re invited to join the Admissions staff for lu
 nch.
DTEND;VALUE=DATE:20111225T215525Z
DTSTART;VALUE=DATE:20111225T175525Z
LOCATION:Nazareth College
SUMMARY:Flyer Friday - Timezone Info Session
UID:ug-flyerfriday-172
END:VEVENT
而且您可以看到它使用UTC存储在Zope中,因此问题仅在于它的显示方式:
>>> app.Plone.events[\'ug-flyerfriday-172\'].startDate
DateTime(\'2011/12/25 17:55:25 GMT+0\')
    

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)