This library looks complicated. I think some tutorial documentation
about how to implement the following use cases would be very helpful to
people that don't really care about leap seconds, etc. <br>
<br>
Also, I see references to POXIS and Unix in System.Time.Calendar. What
is the portability of this module? Will it be implemented for Windows?<br>
<br>
Use cases (primarily taken from real-world corporate IT applications I have developed) :<br>
<br>
* What is the equivalent (or closest aproximation) of the SQL DateTime
type (date and time without any timezone information)? What is the
equivalent of the SQL Date type (date without any timezone information)?<br>
<br>
* The user enters a date as &quot;7/4/2005.&quot; How do I determine if this date is before or after July 1st of this year?<br>
<br>
* How do I present the date &quot;July 1st of this year&quot; to the user in M/D/YYYY format?<br>
<br>
* How do I truncate a datetime to midnight of the same day? How do I
truncate a date to the first of the month? How do I truncate a date to
the first day of the year it occurred in?<br>
<br>
* Given a date X, how do I find the last day of the month that X occurs
in. For example, If X is July 4th, 2005, then I want the result to be
July 31st, 2005. If X is Februrary 5, then I want the result to be
Februrary 28 for non-leap-years and February 29 for leap years.<br>
<br>
* The user enters a time T with no date, e.g. &quot;17:30&quot;. How do I merge
this time onto a date D (e.g. July 4, 2005), so that the result has is
a datetime with date D and the time T (July 4, 2005 at 17:30).<br>
<br>
* Given two datetimes T1, T2, how do I determine if they are on the same date?<br>
<br>
- Brian<br>
<br><div><span class="gmail_quote">On 7/5/05, <b class="gmail_sendername">John Meacham</b> &lt;<a href="mailto:john@repetae.net">john@repetae.net</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;">
It needs a<br>getTAItime :: IO AbsoluteTime<br>and&nbsp;&nbsp;a<br>getLeapSecondTable :: IO LeapSecondTable<br><br>Many systems have ways to get at these and it would be a travesty if we<br>didn't fix this hole in the API when we have the chance. As always, the
<br>library should make its best effort to get at this info. which on POSIX<br>systems might be converting from UTCtime. but on other systems, TAItime<br>might be the accurate one and UTCtime will have to be aproximated from
<br>it. (or on systems with up-to-date leap second tables they can both be<br>accurate).<br><br>Also, it would be nice if the LeapSecondTable was not a functional type,<br>but rather something with structure, like a list of (year,offset) pairs.
<br>There could be apps that will have to look at which years the leap<br>seconds actually occured in and probing the function with every possible<br>value in its domain is not very fun.<br><br>Also, shouldn't AbsoluteTime be an instance of several Num classes?
<br><br>What units does DiffTime have? is it relative, or is the length of<br>a DiffTime independent of what you do to it?<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;John<br>--<br>John Meacham - ⑆repetae.net⑆john⑈<br>_______________________________________________
<br>Libraries mailing list<br><a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/libraries">http://www.haskell.org/mailman/listinfo/libraries</a><br></blockquote>
</div><br>