<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 9, 2021 at 4:40 AM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>> wrote:<br></div><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;color:rgb(0,0,0);text-align:left" dir="ltr">
                                        Hi Bernhard --<div><br></div><div>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.</div></div></blockquote><div><br></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></div><div class="gmail_default" style="font-size:small">       self asUTC hasEqualTicks: aDateAndTimeOrTimeStamp asUTC </div><div class="gmail_default" style="font-size:small"><br></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></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 class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">All the best,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Ron  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><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;color:rgb(0,0,0);text-align:left" dir="ltr"><div><br></div><div>In any case, "DateAndTime today" and "Date today" have different use cases. If you need an accurate timestamp, use DateAndTime. If you write an application that needs to handle time of some sorts (including calendars and games), use Date, Month, Week, Year.</div><div><br></div><div>Looking at the "STON" project, I find it strange that there are extensions on both DateAndTime and Date, given that this is primarily used in version control. You should only use DateAndTime in such scenarios.</div><div><br></div><div>Best,</div><div>Marcel</div><div></div>
                                        <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px;min-width:500px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 08.12.2021 23:22:03 schrieb Bernhard Pieber <<a href="mailto:bernhard@pieber.com" target="_blank">bernhard@pieber.com</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">Hi everyone,<br><br>I am quite puzzled that the following answers false:<br>DateAndTime today asDate = Date today.<br><br>The reason seems to be the localOffsetSeconds. While DateAndTime today asDate has a local timezone, Date today has not. Shouldn’t this be consistent?<br><br>The following answers false as well:<br>Date today start = DateAndTime today<br><br>I assume it is for the same reason.<br><br>I suppose this is a feature, not a bug, but what is the reason for this behaviour?<br><br>Cheers,<br>Bernhard<br><br><br><br></div></blockquote></div><br>
</blockquote></div></div>