[Pharo-project] timezone madness

Pavel Krivanek pavel.krivanek at gmail.com
Tue Jul 10 13:27:49 EDT 2012

We discussed it with Camillo and our result are this proposed changes:
- DateAndTime internally uses only UTC times
- offset changes only the timezone
- asSeconds returns seconds in UTC
- fromSeconds takes seconds in UTC and creates a DateAndTime in local time

-- Pavel

On Tue, Jul 10, 2012 at 6:24 PM, Camillo Bruni <camillobruni at gmail.com> wrote:
> On 2012-07-10, at 18:23, Pavel Krivanek wrote:
>> On Tue, Jul 10, 2012 at 6:20 PM, Camillo Bruni <camillobruni at gmail.com> wrote:
>>>> The problem is that the epoch was always in local time so the logic
>>>> behind it and tests were a mess.
>>>> Now the epoch starts in one defined moment. Sorry for the failing
>>>> tests but chronology tests were ok and the monkey reported no other
>>>> failures so I supposed that the fix was working well.
>>>> -- Pavel
>>> But I want these two objects to be exactly the same (aka in the same time zone)
>>> t := DateAndTime now.
>>> t2 := DateAndTime fromSeconds: t asSeconds.
>>> is that now the case?
>> No, the t2 will be the same time but in UTC zone.
> this does not make sense... If I create a new DateAndTime object it should
> be created in the current time zone.
> This is for instance how ruby works as well...

More information about the Pharo-dev mailing list