develooper Front page | perl.datetime | Postings from January 2003

Re: Picking up the ball

Thread Previous | Thread Next
Dave Rolsky
January 11, 2003 12:36
Re: Picking up the ball
Message ID:
On Fri, 10 Jan 2003, Brad Hughes wrote:

> > -- It should handle fractional seconds.  Based on a brief perusal of
> > Date::ICal, I think this can be added without too much difficulty.
> By "fractional", I hope you mean "counted numbers of subsecond chunks"
> instead of a real number representing a fraction of a second.  I have no
> strong preference for what subsecond chunk is used.  (A VMS timestamp's
> "chunk" is 100 nanosends, or 1/100 of a second, i.e.

I assume you're suggesting this because it's kind of odd to imagine 1/3 of
a second?  That seems logical.

Anyone want to speak up and say that they really needs fractions of a
second before it's too late?

Time::HiRes returns microseconds, so it's a given we have to support at
_least_ microseconds, because this should work without loss of precision:

  my $dt = DateTime->new( epoch => Time::HiRes::time() );

The TAI64 standard supports attoseconds, but that just seems excessive.
I think that if the base class is well-designed, it'll be possible to swap
in a DateTime::Implementation::TAI64 object wherever a DateTime object
works.  Conversion to and from this implementation would be lossy, but
I think that's ok as long as this is well documented.

For now, I'd just say let's support microseconds.  But I'm just making
this up.  I should stress to people on this list that I am _not_ an expert
on date/time issues.  I just have a good idea of what a unified set of
datetime classes should look like API-wise.  So I really hope that people
with expertise in various areas speak up and help with implementation.


House Absolute Consulting

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About