[squeak-dev] The Trunk: Kernel-bf.995.mcz

Chris Muller asqueaker at gmail.com
Fri Feb 19 00:05:29 UTC 2016


I thought #useLocale would be sufficient here.  If one is has
#useLocale turned on, it would mean automatic update, otherwise, not.

On Thu, Feb 18, 2016 at 5:16 PM,  <commits at source.squeak.org> wrote:
> Bert Freudenberg uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-bf.995.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-bf.995
> Author: bf
> Time: 18 February 2016, 3:16:12.729637 pm
> UUID: d871efd5-be20-4ad9-9a1d-c1b24dce73b5
> Ancestors: Kernel-bf.994
>
> Add preference to disable automatic timezone adjustment.
>
> =============== Diff against Kernel-bf.994 ===============
>
> Item was changed:
>   Magnitude subclass: #DateAndTime
>         instanceVariableNames: 'seconds offset jdn nanos'
> +       classVariableNames: 'AutomaticTimezone ClockProvider LastClockValue LocalTimeZone NanoOffset'
> -       classVariableNames: 'ClockProvider LastClockValue LocalTimeZone NanoOffset'
>         poolDictionaries: 'ChronologyConstants'
>         category: 'Kernel-Chronology'!
>
>   !DateAndTime commentStamp: 'brp 5/13/2003 08:07' prior: 0!
>   I represent a point in UTC time as defined by ISO 8601. I have zero duration.
>
>
>   My implementation uses three SmallIntegers
>    and a Duration:
>   jdn           - julian day number.
>   seconds       - number of seconds since midnight.
>   nanos - the number of nanoseconds since the second.
>
>   offset        - duration from UTC.
>
>   The nanosecond attribute is almost always zero but it defined for full ISO compliance and is suitable for timestamping.
>   !
>
> Item was added:
> + ----- Method: DateAndTime class>>automaticTimezone (in category 'preferences') -----
> + automaticTimezone
> +       "Accessor for the system-wide preference"
> +
> +       <preference: 'Automatically set local timezone'
> +               category: 'general'
> +               description: 'If enabled, the timezone will automatically be kept in sync with the system''s time (daylight savings changes etc.)'
> +               type: #Boolean>
> +       ^AutomaticTimezone ifNil: [ true ]!
>
> Item was added:
> + ----- Method: DateAndTime class>>automaticTimezone: (in category 'preferences') -----
> + automaticTimezone: aBoolean
> +       "Accessor for the system-wide preference"
> +
> +       AutomaticTimezone := aBoolean!
>
> Item was changed:
>   ----- Method: DateAndTime class>>now (in category 'ansi protocol') -----
>   now
>         | clockAndOffset |
>         clockAndOffset := self clock localMicrosecondClockWithOffset.
> +       (self automaticTimezone and:
> +               [self localOffset asSeconds ~= clockAndOffset second])
> +                       ifTrue: [self localOffset: (Duration seconds: clockAndOffset second)].
> -       self localOffset asSeconds ~= clockAndOffset second ifTrue: [
> -               self localOffset: (Duration seconds: clockAndOffset second)].
>         ^self now: clockAndOffset first offset: self localOffset!
>
>


More information about the Squeak-dev mailing list