[squeak-dev] Class comment for Date mentions #localizedDates

Chris Cunningham cunningham.cb at gmail.com
Mon Jun 27 18:27:12 UTC 2016


>
> For what it is worth, I spend >80% of my time working with
> dates/timestamps, trying to turn them into Magnitudes for manipulations.
> The other 20%, I really enjoy them as timespans with locales since I deal
> with times from around the world.  But the two uses are not quite easy to
> deal with - doable, just not quite intuitive.
>

So if we store the start time isn't the conversion to a magnitude simply an
inst var access?

That's mostly what I do.  But it depends on how the Date is created.  For
instance, unless you live in the UTC time zone, the following is true:

Date today = DateAndTime now asDate  "==>true"
Date today start = DateAndTime now asDate start  "==>false"
Date today start asSeconds = DateAndTime now asDate start asSeconds
 "==>true"

And, of course, it isn't a DAY that we are talking about - it is a
DateAndTime (a specific point in time).

It's just remembering which corner cases are true, and which aren't, at any
given time.

(as an aside, I find it interesting that Timespan current gives you a day.
It is what Date today is based off of - so don't ever change that Timespan
#current method!)

-cbc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160627/5baefbdb/attachment.htm


More information about the Squeak-dev mailing list