[squeak-dev] Should a long running image notice daylight saving?

Herbert König herbertkoenig at gmx.net
Sun Apr 2 12:44:48 UTC 2017


Hi Levente,

thanks, it works. I even had read the discussion and somehow misread 
that it was about moving from one timezone to another. :-(

Cheers,


Herbert


Am 02.04.2017 um 14:08 schrieb Levente Uzonyi:
> Hi Herbert,
>
> This issue was discussed[1] here recently. I suggested[2] a VM change 
> to solve this problem, but the same thing can be done on the image 
> side too.
> Just change Time class >> #utcMicrosecondClockWithOffset to be:
>
> utcMicrosecondClockWithOffset
>     "Answer an array with UTC microseconds since the Smalltalk epoch 
> and the
>     current seconds offset from UTC in the local time zone."
>
>     | utc currentMinute |
>     utc := self utcMicrosecondClock.
>     currentMinute := utc // 60000000.
>     LastTimeTimeZoneWasUpdated = currentMinute ifFalse: [
>         LastTimeTimeZoneWasUpdated := currentMinute.
>         TimeZoneOffset := Locale current primTimezone * 60 ].
>     ^{ utc. TimeZoneOffset }
>
> and Time class >> #localMicrosecondClock to be:
>
> localMicrosecondClock
>     "Answer the local microseconds since the Smalltalk epoch (January 
> 1st 1901, the start of the 20th century).
>      The value is derived from the current UTC wallclock time and the 
> image's current notion of time zone."
>
>     | utcMicrosecondClockWithOffset |
>     utcMicrosecondClockWithOffset := self utcMicrosecondClockWithOffset.
>     ^(utcMicrosecondClockWithOffset at: 2) * 1000000 + 
> (utcMicrosecondClockWithOffset at: 1)
>
>
> LastTimeTimeZoneWasUpdated and TimeZoneOffset should be class 
> variables. They don't have to be initialized.
>
> Levente
>
> [1] 
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2017-March/193594.html
> [2] 
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2017-March/193638.html
>
> On Sun, 2 Apr 2017, Herbert König wrote:
>
>> Hi all,
>>
>> I have a long running 5.1 image on a Raspi A+ which regularly waits 
>> on a Delay.
>>
>> Raspbian has noticed daylight saving, Squeak not.
>>
>> Is this expected and what can I do with the running image to make it 
>> notice? Except waiting for the monthly crash and restart :-)
>>
>>
>> Cheers,
>>
>> Herbert
>>
>>
>>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170402/9cb6c5b4/attachment.html>


More information about the Squeak-dev mailing list