<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 9, 2021, at 9:06 AM, Ron Teitelbaum <<a href="mailto:ron@usmedrec.com" class="">ron@usmedrec.com</a>> wrote:</div><div class=""><div dir="ltr" class=""><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id="gmail-m_6304756479216109391__MailbirdStyleContent" style="font-size: 10pt; font-family: Arial; text-align: left;" dir="ltr" class=""><div class=""><span style="font-size: 10pt;" class="">Date is a Timespan while DateAndTime is not. I think we should drop the timezone offset when converting a DateAndTime to a Date. Yet, the class comment of Date reads, that there are rare cases where one would need such an offset. Not sure.</span></div></div></blockquote><div class=""><br class=""></div><div class="gmail_default" style="font-size:small">In my opinion, The result of the comparison should only consider the result of the date with the offset applied.  While it is true that the original date + offset might result in a different date the result should still be true if the resulting dates are the same.  One is the result of the date plus the offset the other is a date but they are both Functionally equal.  The results currently are converting both dates to UTC before the comparison.   </div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">       self asUTC hasEqualTicks: aDateAndTimeOrTimeStamp asUTC </div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">That to me is the error.  If you wanted to make that comparison you would do asUTC yourself to remove timezone information.  </div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">I can not fathom a reason that DateAndTime today asDate = Date today.  is better by returning false.  Anyone worried about timezones in this instance would use UTC or local conversions first before doing the comparison. </div></div></div></div></blockquote></div><br class=""><div class="">I just found an old 5.1 image where I was playing around with something similar.  </div><div class=""><br class=""></div><div class=""><div class="">| x c y |</div><div class="">x := TimeStamp now.</div><div class="">c := String streamContents: [:s | x storeOn: s].</div><div class="">y := TimeStamp readFrom: c readStream.</div><div class="">x = y   " => false  "</div></div><div class=""><br class=""></div><div class="">whereas:</div><div class=""><br class=""></div><div class=""><div class="">| x c y |</div><div class="">x := TimeStamp now asUTC.</div><div class="">c := String streamContents: [:s | x storeOn: s].</div><div class="">y := TimeStamp readFrom: c readStream.</div><div class="">x = y   " =>  true   "</div></div><div class=""><br class=""></div><div class="">The difference being that "Timestamp now" has localOffsetSeconds of -25200 (where I live), but this offset is not getting stored via TimeStamp>>#storeOn: (which produces '''22 April 2022 11:48:17.542009 am'' asTimeStamp' ).</div><div class=""><br class=""></div><div class="">I suspect this could be avoided if Squeak were using ISO 8601 formatting for TimeStamp>>#storeOn:   which might capture local time zone info using + or T or something at the end of the string.  But then the code for TimeStamp class>>#readFrom: eventually hits Time class>>#readFrom: which does not support offsets / time zones either.</div><div class=""><br class=""></div><div class="">Reading what Ron wrote above, it seems that the onus is on the user of these classes to remember to use #asUTC, which seems common/best practice...  and avoids unexpected(?) results like the above.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Tim</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>