Re: ANNOUCE: DateTime::Format::DateManip

2003-07-01 Thread Joshua Hoblitt
Looks good Ben.  The timezone stuff must have been fun. :)

I ported a small piece of code (in production though) from Date::Manip to DT not long 
ago.  I've been meaning to post the diffs and the benchmarks to the list.  I'll do it 
as soon as I'm back on a fast connection.

 Sometime I want to finish writing DateTime::Format::Complex that will
 grok complex English (although I want it to be localizable) date
 strings.  But that is still under consideration.

Has DateTime::Format::ISO8601::(?:Complex) grown into this or is it a different module?

-J

--



Re: ANNOUCE: DateTime::Format::DateManip

2003-07-01 Thread Ben Bennett
On Tue, Jul 01, 2003 at 09:04:14AM -1000, Joshua Hoblitt wrote:
 Looks good Ben.  The timezone stuff must have been fun. :)

Fun in which sense of the word :-)

 
 I ported a small piece of code (in production though) from Date::Manip to DT not 
 long ago.  I've been meaning to post the diffs and the benchmarks to the list.  I'll 
 do it as soon as I'm back on a fast connection.

Cool.
 
  Sometime I want to finish writing DateTime::Format::Complex that will
  grok complex English (although I want it to be localizable) date
  strings.  But that is still under consideration.
 
 Has DateTime::Format::ISO8601::(?:Complex) grown into this or is it a different 
 module?

No DT::F::ISO8601 (::?) is still a separate beast (which may get
called by DT::F::Complex).  ISO8601 parsing is pretty much done except
for recurrences...  I have some questions how to translate a
recurrence that has 5 instances 20 minutes apart but does not give a
start or end time.  I may just do as I do elsewhere and use an
optional user provided time (and fall back to now()).

We should get this name thing resolved so we can get both modules
committed and up on CPAN.  I don't care either way.

-ben


Re: ANNOUCE: DateTime::Format::DateManip

2003-07-01 Thread Flavio S. Glock
Ben Bennett wrote:
 No DT::F::ISO8601 (::?) is still a separate beast (which may get
 called by DT::F::Complex).  ISO8601 parsing is pretty much done except
 for recurrences...  I have some questions how to translate a
 recurrence that has 5 instances 20 minutes apart but does not give a
 start or end time.  I may just do as I do elsewhere and use an
 optional user provided time (and fall back to now()).

That would generate a DateTime::Duration::Set, 
but we don't have this class yet :)

  print DT::Format::ICal-duration_set( $dur_set );
  # PT0M,PT20M,PT40M,PT60M,PT80M

- Flavio S. Glock


Re: ANNOUCE: DateTime::Format::DateManip

2003-07-01 Thread Ben Bennett
On Tue, Jul 01, 2003 at 07:36:48AM -0700, Hill, Ronald wrote:
 Yes, and so will Date::Calc (that is what I use) But I wanted to use only
 one
 Date module. It makes no sense to use say Date::Calc with DateTime.

I know you provided a code snippet below, but in general when using
Date::Calc do you use GMT or Local time when doing the operations?

If you mix the two, how do you keep track of which is which?

Do you use Date::Calc::Object?

I am trying to work out what the interface should be for a possible
DateTime::Format::DateCalc converter.  I think it is too complicated
to use the typical parse_datetime() style (because you need to tell
the sub whether it is in GMT or local time).  Also it would be nice to
have a sub that could take the date and time parts and put them
together into a DT and vice versa.

Anyway, any suggestions would be appreciated.

Thanks,

  -ben


Re: ANNOUCE: DateTime::Format::DateManip

2003-07-01 Thread Dave Rolsky
On Tue, 1 Jul 2003, Joshua Hoblitt wrote:

 Agreed.  I think it should boil down to recurrences and durations..  If
 most people need that functionality then lets call your module
 DT::F::ISO8601 and I'll use ISO8601::Simple.  If they don't then I'll
 take ISO8601 and you can use ISO8601::Complex.

Is there any reason it can't all go in one module?  I think that'd be much
easier for end users.


-dave

/*===
House Absolute Consulting
www.houseabsolute.com
===*/


Re: ANNOUCE: DateTime::Format::DateManip

2003-07-01 Thread Joshua Hoblitt
 Is there any reason it can't all go in one module?  I think that'd be much
 easier for end users.

Yes.  Ben and I have discussed this off list.  In fact that discussion is, I believe, 
where the DT::F::DateManip module came from.  I started on this several months ago and 
never got around to finishing it - Ben didn't know that and hard already started on 
his module.  I think it's ok though as they are really very different and I think 
Ben's parser has a lot of potential for supporting different syntaxes when it matures.

I wanted to put my module into shared CVS some time ago but nobody has commented on 
the namespace issue...

-J

--



Re: ANNOUCE: DateTime::Format::DateManip

2003-07-01 Thread Joshua Hoblitt
 My module is a superset of Joshua's... however, mine still needs the
 interface to be polished (I plan on adding a way to select which
 optional pieces of ISO8601 are legal).

Hmm... I could use your module for recurrence and duration parsing.

-J

--



ANNOUCE: DateTime::Format::DateManip

2003-06-30 Thread Ben Bennett

I needed to convert between Date::Manip and DateTime so I wrote a
module to convert the date and duration formats (recurrences may
follow if there is demand, there are some nasty wrinkles though).

Get it from http://www.limey.net/~fiji/perl/

If people see no major problems with this module I will add it to CVS
and CPAN.  I also want to update the FAQ with a section on how to
convert between different timezone modules, since most of the other
modules use epochs that is easy to handle.

I wanted to write one to convert Date::Calc::Object as well, but
timezones really get ugly there.  Since the TZ info is not kept with
the object the user would have to tell us whether it was in local or
GMT time when converting in both directions.  I am still thinking
about how to handle the interface in a sane manner.

-ben