[Pharo-project] What can be negative regarding timezones with date-related objects?

Mariano Martinez Peck marianopeck at gmail.com
Sat Jun 9 14:19:58 EDT 2012


On Sat, Jun 9, 2012 at 8:05 PM, Sven Van Caekenberghe <sven at beta9.be> wrote:

> Not used as offset in DateAndTime, Durations can be anything, both
> negative as well as positive, like in
>
> '2010-01-02' asDate - '2012-06-08' asDate
>
> '2010-01-02' asDate - DateAndTime now
>
>
Ok, thanks Sven.


> On 09 Jun 2012, at 19:53, Mariano Martinez Peck wrote:
>
> >
> >
> > On Sat, Jun 9, 2012 at 2:53 PM, Sven Van Caekenberghe <sven at beta9.be>
> wrote:
> >
> > On 09 Jun 2012, at 14:24, Mariano Martinez Peck wrote:
> >
> > > The seconds/nanoseconds are always positive when normalized.
> > >
> > > Are you sure?
> > > I have just changed (for testing) to this:
> > >
> > >     DateAndTime localTimeZone: (TimeZone timeZones detect: [:tz | tz
> abbreviation = 'EST']).
> > >
> > > And now if I do:
> > >
> > > DateAndTime now offset asSeconds ---->   -18000
> >
> > The seconds/nanoseconds in DateAndTime itself are like that,
> > the TZ offset can be positive and negative:
> >
> > http://en.wikipedia.org/wiki/Timezone
> >
> > <<Most of the 40 time zones on land are offset from Coordinated
> Universal Time (UTC) by a whole number of hours (UTC-12 to UTC+14), but a
> few are offset by 30 or 45 minutes.>>
> >
> >
> >
> > Ok, perfect. And what about durations outside DateAndTime. Say if I do:
> "-123 seconds"   is that valid?  I mean, should we accept normal durations
> (not the instVar offset of a DateAndTime) with negative seconds/nanoseconds?
> >
> > thanks
> >
> >
> > --
> > Mariano
> > http://marianopeck.wordpress.com
> >
>
>
>


-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20120609/b40f3832/attachment.html>


More information about the Pharo-dev mailing list