Dave Rolsky wrote:
- Work with just dates and do date math on them (at the level of days,
months & years).
I think I was one of the ones advocating for a way to do this, since in
a business environment, the time is frequently not important (for
example number of days between order and shipment, or shipment and
payment). I'd have to look back at the archives, but I believe I
suggested either undef for the time values or internally setting the
time to a fixed UTC time for all DT objects without time (like 12 noon,
to stay away from any possible leap-day magic). It would require all
math operations to be smarter, but I don't think it would require a
completely redesigned API.
For example, consider an object like this:
year,
month,
day,
hour,
minute,
second,
TZ
and at any point in that sequence, allow the user to set the value to
undef (for "I don't have any information about anything below this").
All math operations would then stop at the point where either term (for
binary operations) contained an undef (hence two disimilarly accurate DT
objects would have a result no more accurate than the least accurate
term). This would allow reduced precision date math to happen naturally.
John
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5748