<div><br></div>I agree Chris. If I'm interested in anything time-related for a given date, I'll use DateAndTime or TimeStamp or whatever. Date objects should care about year and month and day, and nothing more.<div>
<br></div><div>Incidentally, the place I'm using Dates that is screwing me up so badly is as the key to a Dictionary, so of course the TZ offset makes it so the key lookup fails when you change TZ's.</div><div><br>
</div><div>- Jon</div><div><br><br><div class="gmail_quote">On Thu, Feb 2, 2012 at 11:25 AM, Chris Muller <span dir="ltr"><<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, Feb 2, 2012 at 2:30 AM, Nicolas Cellier<br>
<<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br>
> I'm now inspecting implementation, and indeed, Date is an interval<br>
> taking start time into account.<br>
> So you can still compare the Date printString... (quite slow).<br>
<br>
</div>Not good enough, because having TZ-specific dates in any system of<br>
consequence is a scourge of molasses.<br>
<br>
Best to strip all Dates (NOT DateAndTimes) of their timezone.<br>
<div class="im"><br>
> I read that makeUTC is like asUTC but it's not.<br>
> The former just erase the offset, the later does remove the offset from time.<br>
><br>
> t := DateAndTime year: 2012 month: 2 day: 1 hour: 9 minute: 8 second:<br>
> 23 offset: 2 hours.<br>
> self deny: t asUTC = t copy makeUTC<br>
<br>
</div>makeUTC was intended solely to purge the molasses for apps that are<br>
not interested in TZ's.<br>
<div class="im"><br>
> Since midnight is used in Date creation, I now have the answer how<br>
> germane it is to compare the dates of two DateAndTime.<br>
><br>
> d1 := DateAndTime starting: (DateAndTime year: 2012 month: 2 day: 1<br>
> hour: 15 minute: 0 second: 0 offset: 8 hours).<br>
> d2 := DateAndTime starting: (DateAndTime year: 2012 month: 2 day: 1<br>
> hour: 20 minute: 0 second: 0 offset: 0 hours).<br>
> self guess: d1 asDate = d2 asDate answer: 'it depends on your local time zone'.<br>
><br>
> Well, why not, but good luck to write the SUnitTests, you have to<br>
> modify a global (time zone) to make them work reliably ;)<br>
<br>
</div>We've made something wrong and we've made it slow in the process.<br>
Apps that care about timezones will use DateAndTimes. Apps that don't<br>
shouldn't be punished.<br>
<br>
I propose Date's, by default, be created with the UTC offset, NOT the<br>
local offset.<br>
<span class="HOEnZb"><font color="#888888"><br>
- Chris<br>
<br>
</font></span></blockquote></div><br></div>