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

Re: [mplspm]: Picking up the ball

Thread Previous | Thread Next
From:
Martijn van Beers
Date:
January 13, 2003 10:36
Subject:
Re: [mplspm]: Picking up the ball
Message ID:
20030113183547.GB7967@erebor.copa.nl
On Mon, Jan 13, 2003 at 10:07:05AM -0800, David Wheeler wrote:
> On Sunday, January 12, 2003, at 11:42  PM, Matt Sergeant wrote:
> 
>> Parsing should not be in a base date time class though - it has no 
>> place there.
> I disagree. I think that some very fundamental parsing needs to go into 
> the base class. You should be able to construct a DateTime object for 
> whatever date and time you need,
This is not an argument for doing parsing in the base object. You can
create a DateTime object for whatever date you want without any
parsing:

	DateTime->new (jd => 10, jsec => 3600);

or
	DateTime->new (year => 1, month => 2, monthday => 3);

> and to do that, it has to be able to 
> parse a date/time argument.

Parsing just means turning a string into a set of arguments that
the DateTime object understands.

> But nothing fancy, just a few formats should be supported in the
> base class, including epoch time, ICal, and maybe ISO 8601.

I wouldn't call epoch arguments parsing, but I would really
like it if this wasn't in the base class. Making people go
through extra steps to use epoch is a good thing, which
will hopefully make them think about using it a bit
more.


Martijn

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About