[interfacekit] parsedate() now complete
- From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
- To: "OpenBeOS Interface Kit" <interfacekit@xxxxxxxxxxxxx>
- Date: Tue, 26 Aug 2003 04:41:45 +0200 CEST
Shortly after I introduced the parsedate() functions to the Support
Kit, they are now complete.
I will do the docs later on, and since we already have some doxygen
style docs, I will do it using that format - if we need to convert it
to XML, I am sure we can easily extend doxygen to produce that format,
too (as it already does HTML).
Anyway, for your reading pleasure, a short list of what I changed wrt
the R5 implementation:
- "last tuesday" (and friends) is working correctly; unlike "next
tuesday", it didn't work in R5
- "next/last x minutes/seconds/hours" is now also accepted as a 'T' (a
time unit), was invalid before
- sets the PARSEDATE_MINUTE_RELATIVE_TIME if the parsed time would
change with every minute passed (i.e. Tracker right now only redo the
query daily, even if you ask for files changed in the past 5 minutes)
- now sets PARSEDATE_INVALID_DATE if the date could not be parsed - to
be able to distinguish between unknown and invalid dates (the former
could be fixed by adding more formats)
- many time zone specifications are still missing, I only added "GMT"
Like the original, it will ignore wrong weekday settings (like "Monday,
2003/08/26", even if it's a tuesday).
Also, I've done some speed tests, in order to see if my solution is
appropriate, every conversion was carried out 500000 times (OpenBeOS
vs. R5):
strings like "next tuesday":
9.5s vs. 13s
absolute date "1976-12-15":
6.7s vs. 11.2s
empty string "":
0.06s vs. 7.1s
NULL string:
0.04s vs. crash
unparseable string, like "Gurkensalat":
1.5s vs. 11.1s
Looks good enough to me. Of course, adding more time zones could cause
slightly more overhead in the case of the unparseable string.
Adios...
Axel.
Other related posts:
- » [interfacekit] parsedate() now complete