Activestate PPMs for DateTime?

2004-11-01 Thread Joshua Hoblitt
Has anyone that is a win32/activeperl user complained to Activestate that they
are not providing a DateTime PPM?  I assume that DateTime is still working on
win32 but the PPM status page shows that DT 0.22 is failing to build on _all_
platforms.
-J
--
-- Forwarded message --
Date: Sun, 31 Oct 2004 08:43:14 -0500
From: Ricardo SIGNES [EMAIL PROTECTED]
To: Joshua Hoblitt [EMAIL PROTECTED]
Subject: Re: Time::Human
* Joshua Hoblitt [EMAIL PROTECTED] [2004-10-30T22:08:31]
I'd like to see Time::Human become just a wrapper for
DateTime::Format::Human.
Would it be possible for you to submit patches against DT::F::Human instead?
That's not really acceptable for me.  I can't use DateTime at work
because it can't be automatically deployed via the ActiveState PPM
system.  I like DateTime, but until it's automatically installable, it
does me no good at work.
--
rjbs


Re: Activestate PPMs for DateTime?

2004-11-01 Thread Dave Rolsky
On Mon, 1 Nov 2004, Joshua Hoblitt wrote:
Has anyone that is a win32/activeperl user complained to Activestate 
that they are not providing a DateTime PPM?  I assume that DateTime is 
still working on win32 but the PPM status page shows that DT 0.22 is 
failing to build on _all_ platforms.
It's cause it needs Module::Build for some of the dependencies and their 
build boxes don't have Module::Build installed (which is goofy).

-dave
/*===
VegGuide.Org
Your guide to all that's veg.
===*/


Re: Activestate PPMs for DateTime?

2004-11-01 Thread Joshua Hoblitt
That is goofy... has anyone opened a trouble ticket on this or complained
directly?
-J
--
On Mon, 1 Nov 2004, Dave Rolsky wrote:
On Mon, 1 Nov 2004, Joshua Hoblitt wrote:
Has anyone that is a win32/activeperl user complained to Activestate that 
they are not providing a DateTime PPM?  I assume that DateTime is still 
working on win32 but the PPM status page shows that DT 0.22 is failing to 
build on _all_ platforms.
It's cause it needs Module::Build for some of the dependencies and their 
build boxes don't have Module::Build installed (which is goofy).

-dave
/*===
VegGuide.Org
Your guide to all that's veg.
===*/


Re: [Comment] Re: [cpan #8160] DateTime::Duration reports incorrect weeks

2004-11-01 Thread Dave Rolsky
[ moving this onto the datetime list because I know it's not a bug ... ]
On Mon, 1 Nov 2004, [EMAIL PROTECTED] via RT wrote:
I think there may be some confusion here.  When you just subtract two
dates you get a duration that has all possible units it could have.  The
in_units method can only convert between two units which have a fixed
conversion (7 days = 1 week, 12 months = 1 year, etc).  It cannot convert
between months  days, because these are not fixed.
But it doesn't give me the right number of days.
Yes it does.
It says:
  * in_units( ... )
  Returns the length of the duration in the units (any of those that
  can be passed to new) given as arguments.  All lengths are inte-
  gral, but may be negative.  Smaller units are computed from what
  remains after taking away the larger units given, so for example:
my $dur = DateTime::Duration-new( years = 1, months = 15 );
$dur-in_units( 'years' );# 2
$dur-in_units( 'months' );   # 27
$dur-in_units( 'years', 'months' );  # (2, 3)
  Note that the numbers returned by this method may not match the
  values given to the constructor.
As I read that, in_units( 'days' ) should tell me how many units of 24
hours there are in the period but it doesn't.
It does, but it doesn't convert months to days.  How could it do that? 
Each month has a different number of days.

Likewise, in_units( 'weeks' ) should tell me how many whole weeks are in
the period and in_units( 'weeks', 'days' ) should give me the number of
whole weeks and the remaining days.
It does.  But if the duration has 2 months  8 days, then it only has 1 
week, not 9 (or 10).

in fact it seems to ignore weeks entirely and give me the remaining days
after the months have been taken off *always* (but how can it know unless
the duration has some concept of place in time ?), and not the total
number of days in the period as I would expect from those docs.
Actually, that's backwards.  It could only know how to convert months to 
days (in the duration) if the duration had an anchor from which to 
calculate.  This anchor exists when you did your date subtraction 
originally, so by default you get a duration with months, days, minutes, 
seconds,  nanoseconds.

If you just want days, you can use the delta_days() method.
I actually found another way around it in this case but fixing it would be
good for future work.
There's nothing to fix.  This is all documented in the How Date Math is 
Done section of the DateTime.pm docs.  I think the docs for in_unit in 
DateTime::Duration could be improved so as to be less confusing, however.

-dave
/*===
VegGuide.Org
Your guide to all that's veg.
===*/