On 26 Mar 2017, at 21:56, Stephane Ducasse <stepharo.self@gmail.com> wrote:
Did you check the Zn counterpart because I know that some parts are much better. But I do not have them at hand.
You mean ZTimestamp (but it is not a part of Zinc HTTP Components). https://github.com/svenvc/ztimestamp This is an UTC, second precision timestamp without TZ info, and a number of interesting tools. However, that won't solve the issue raised. Some people think of a date as an abstract calendar date, while for others its a concrete day (my Monday is not your Monday if we are in different time zones). I don't think there is only one solution, both roles are needed/useful. Note that STON serialises Dates as YYYY-MM-DD which is what you seem to want. The ZTimezone class knows about the exact transitions, but that still does not mean that no weird things happen at the transition point, au contraire ;-)
Stef
On Sun, Mar 26, 2017 at 10:17 AM, Petr Fischer <petr.fischer@me.com> wrote: Hello,
1) when I create date on: 2017/03/20 (before Daylight Saving Time change) with this code:
D1 := Date year: 2017 month: 3 day: 26.
Date object is created with instvars: start: 2017-03-26T00:00:00+01:00 duration: 1:00:00:00
2) when I create same Date instance with the same code on/after: 2017/03/26 (after Daylight Saving Time change):
D2 := Date year: 2017 month: 3 day: 26.
Date instance with this instvars returned: start: 2017-03-26T00:00:00+02:00 duration: 1:00:00:00
3) D1 != D2
So, for example: persisted instance of date (Date year: 2017 month: 3 day: 26) created before DST change is not equal with date instance (Date year: 2017 month: 3 day: 26) created after DST change. DST change breaks equality of the same date :(
Is it OK?
Thanks! Petr Fischer