|
Boost : |
From: andreas_huber69 (andreas_at_[hidden])
Date: 2001-12-16 09:48:41
Hello there
I'm really unhappy with the date/time handling facilities currently
provided by the standard library.
Since I haven't found anything about this on the boost website, I am
thinking about submitting a proposal on general purpose date/time
handling classes.
A short (incomplete) summary of the features I have in mind follows:
class time:
- Represents an absolute point in time.
- The time of the day can be specified in hours, minutes, seconds and
nanoseconds.
- The date can be specified with the Gregorian calendar, support for
other calendars can easily be added without modifying the time class.
- Any point in time from about 4000BC until about 50000 years in the
future can be represented.
- Text I/O is done through functions provided by
std::time_get/std::time_put facets (only the range of std::tm is
therefore supported).
class timespan (or time_span if you prefer):
- Represents a period of time (or the difference between two points
in time). Can be specified in days, hours, minutes, seconds and
nanoseconds
- Supports time spans of up to about 29000 years (positive or
negative).
- Both classes are implemented in terms of 64bit integers and
represent time as a number of ticks (one tick is 100 nanoseconds).
- The usual mathematical operators are supported for time/timespan
calculations.
However, before starting to work on this I would like to hear your
opinion:
- Is this useful for most C++ programmers?
- Is there anything lacking?
- Space/time considerations: Can you think of applications where
64bit for a time object is not feasible (the implementation for
machines without 64bit integers will have to use two 32 bit integers)
- Anything else that comes to mind...
Thanks!
Andreas
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk