<br><br><div><span class="gmail_quote">On 21/11/2007, <b class="gmail_sendername">Scott Wheeler</b> &lt;<a href="mailto:wheeler@kde.org">wheeler@kde.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>But let&#39;s say that you want your ChucKoo clock to let you sleep in on<br>Saturday.&nbsp;&nbsp;Well, then you need your date / time class to be able to<br>report the day of the week.&nbsp;&nbsp;Or if you want to say, &quot;How much time is
<br>there between now and tomorrow at noon?&quot;&nbsp;&nbsp;You need to have API support<br>for adding and subtracting time.</blockquote><div><br><br>I&#39;m sure this is very naive again, but we do have lots of support for adding and subtracting time. We have both &quot;time&quot; and &quot;duration&quot; as datatypes and day, hour, minute,etc, etc, etc as constants ready made.
<br><br>If we&#39;d have even -say- a function that would report the amount of samples that have passed since newyear 2000 in our timezone it would be quite straightforward to discover the amount of time until &quot;tomorow at noon&quot;.
<br><br>The hard bits -as I see it- would be that daylight saving time is variable per country and that within countries this changes as well from year to year (for reasons I don&#39;t quite understand like much of how government works...). Just now I read that people are debating whether we should even observe leap-seconds at all. To me it seems quite clear that we will never be able to make a function that can predict the whims of politicians in every country ChucK may be used in with regard to how we will look at the clock and calendar in the future. I&#39;m not even sure if computers in Israel (which I assume observes the Jewish calender) or China (which I would guess observes the Chinese year) use the same calender as my European computers do.
<br><br>As I see it right now these are cultural questions which don&#39;t need to matter all that much from a ChucKian point of view. If we&#39;d like to establish the time from a ChucKian point of view I think it would do to know the amount of time that has passed since some known point in time (the birth of the universe, ChucK, Unix or one&#39;s favourite religious person, etc) and to know how the calender we&#39;d like to observe works. We already have enough ways to deal with time to take it from there on.
<br></div><br>Admittedly that would be a bit abstract at the expense of ease of use for most people most of the time but I don&#39;t think that a API to reason about time as such is the bottle-neck here.<br><br><br>Ok, now that I think about it there are some quite amusing questions. For example, if we would have such a built in calender/clock, would we be able to use this?;
<br><br>if (day % 24::hour) //check to see if we need to adjust for daylight savings time today<br><br>That would be quite funny. <br>:¬)<br><br>Kas.<br></div>