On Tue, 17 Feb 2009, Darren Duncan wrote:

Talking about dates and times, I have some suggestions.

First of all, I don't think that most DateTime stuff belongs in IO. The class definitions to represent a date or time or duration etc value, as well as operators to convert date formats etc or add/subtract etc dates are strictly internal, same as number or string operations. Only the routines to fetch the current system time and the like belong in IO, or routines concerning file timestamps etc.

I agree they don't belong in that part of the spec; I've just written another e-mail about that ("Spec reorganisation").

Second of all, I think a more generic term than DateTime should be used to name an object that represents an instant in time; for example I suggest calling it "Instant". The name "Instant" fits in a lot better in the company of other generic sounding temporal data types like "Duration" etc. Then, you can say that things like DateTime, Date, Time, etc are subtypes of Instant.

Love the name; I'll do the rename as soon as the Spec reorganisation is sorted out.

It also means that we can use DateTime to refer to Instant+Duration+... :).

See also http://search.cpan.org/dist/Muldis-D/lib/Muldis/D/Ext/Temporal.pod where I've specced out such matters, and that illustrates something I recommend for you. My Instant types very closely resemble both the Perl DateTime library as well as the SQL temporal types, which are actually very similar, though I've generalized it a bit. This spec explicitly does not support time zones (it has UTC or floating, that's it) and it doesn't include conversions with strings, but it has the foundation on which such could be built. And yours doesn't have to be the same of course.

        I'll look into it :).  Thanks,

| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayl...@wayland.id.au    | I am                           |

Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-

Reply via email to