ENHANCEMENTS for time - Add time parsing to the time package. Rationale: The old System.Time has had a TODO "* add functions to parse strings to `CalendarTime' (some day...)" for a long time. The question about date parsing comes up once in a while on the mailing lists (e.g. http://comments.gmane.org/gmane.comp.lang.haskell.cafe/16438). - formatTime: Change %S to: the number of whole seconds. - formatTime: Add %q: the number of picoseconds (including trailing zeroes). - formatTime: Add %Q: decimal point and second decimals, without trailing zeros. If the number of picoseconds is zero, nothing is produced (not even the decimal point). Rationale: Currently %S includes decimals if there are any. This is different from strftime, and there is no format specifier for just the integer part of the seconds. It would be nice to have such a specifier to implement many standard date formats (e.g. RFC 822). Also a specifier for second decimals would also help when using %s. Currently there is no reasonable way to get more than integer second precision with since-epoch timestamps. Thus the current %S would be equivalent to %S%Q under this proposal. - Add %f: The century part of the week date year. Rationale: There is a %g specifier for the last two digits of the week date year, but no specifier for the century. %C cannot be used, since the normal century and the week date century can differ: > formatTime defaultTimeLocale "%Y %G" (fromGregorian 2000 1 1) "2000 1999" - Add fromMondayStartWeek and fromSundayStartWeek to Data.Time.Calendar.OrdinalDate. Rationale: I can't find any duals of mondayStartWeek and sundayStartWeek. They are useful when implementing parsing for %W and %U. - Add Typeable and Data instances for all the time package types. Rationale: It's useful and doesn't hurt anyone. - Add Eq instance for ZonedTime? Rationale: It's useful at least for the QuickCheck properties, but probably also elsewhere. There are lots of standard functions that want Eq. Problems: Should ZonedTimes be converted to UTC and compared, or should times in different timezones never be equal? I would argue for the latter, but I suspect that this problem is the reason why it never got included in the first place. Interestingly, there is a derived instance of Eq for TimeZone, which means that timezones with the same offset but different names are considered different. Following this logic, I think that ZonedTimes with different timezones should also be different. This should be noted in the documentation. - Add secondsToDiffTime and picosecondsToDiffTime. Rationale: As has come up on haskell-cafe (http://comments.gmane.org/gmane.comp.lang.haskell.cafe/15653), it takes a while to figure out how to make DiffTime values. secondsToDiffTime is not that important since it is just another name for fromInteger, but I suspect that it would be used a lot. Using fromRational to create a DiffTime from a number of picoseconds is a bit of a hassle, so having a picosecondsToDiffTime would be useful. BUGS in time - formatTime "%c" does not include the time zone even when applied to ZonedTime or UTCTime, since "%c" is handled by the FormatTime LocalTime instance: > fmap (formatTime System.Locale.defaultTimeLocale "%c") getZonedTime "Sat Nov 11 19:12:45.395568 2006" > fmap (formatTime System.Locale.defaultTimeLocale "%c") getCurrentTime "Sat Nov 11 18:13:52.010944 2006" - s/propleptic/proleptic/ in Data/Time/Calendar/JulianYearDay.hs and Data/Time/Calendar/OrdinalDate.hs - formatTime documentation of range of %U and %W is wrong, should include 00. - The showWeekDate haddock comment is: "show in ISO 8601 Week Date format as yyyy-Www-dd (e.g." BUGS that I'm not sure how to fix - The taiEpoch haddock comment is just "The epoch of TAI, which is" - The haddock comments for many of the Julian calendar functions talk about the proleptic Gregorian calendar. This looks like a copy-and-paste problem. What is the calendar called? Proleptic Julian?