Dates are adjusted for users only at midnight on my xpages

落爺英雄遲暮 提交于 2019-12-02 00:51:58

The issue is related to not having the TimeZone specified in the date / time field. We ran into this just yesterday. If you don't have the TZ specified, it seems to assume UTC and will adjust accordingly. Include the time zone and your field will stop adjusting erroneously.

we encountered the same problem recently and, I believe, found a very nice solution.

system treats the pure date as a date in UTC time zone. Date value is automatically converted into server's time zone. So the question is how to prevent conversion?

this code prevents conversion:

<xp:this.converter>
    <xp:convertDateTime 
        type="date" 
        ignoreUserTimeZone="true" 
        dateStyle="long" 
        timeZone="UTC">
    </xp:convertDateTime>
</xp:this.converter>

pay attention at "timeZone" attribute.

Perhaps it has to do with this ? http://www-304.ibm.com/support/docview.wss?uid=swg21508734

I've seen some reports about XPages Dates and TimeZone Issues

I suspect your Domino version was 8.5.3, because there were 2 APAR, LO72278 and LO67745, on similar problems against 8.5.3. Fixpack 3 addresses them.

The root cause is that Lotus Notes allows you to save a "Date" with no time or zone and the Notes server has a default Time Zone setting to interpret these incomplete things called dates. XPages doesn't play by the same rules, and its master Java wants to know what zone you're using, and looks to the system for some clue, and generally will use midnight within some TZ to refer to a "Date". There is a whole region on Stack Overflow on the "how to store/represent a date" topic - [datetime] - since languages and DBMS each have their own approach.

Nice legacy Notes focused article about it. http://www-10.lotus.com/ldd/ddwiki.nsf/dx/05022009100728PMAGU5MB.htm

XPages article about it http://www-10.lotus.com/ldd/ddwiki.nsf/dx/XPagesTimeZones.htm

Too bad they are not totally on the same page, I assume each release gets closer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!