[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-datetime
Subject:    Re: [cpan #6982] DateTime->strptime()
From:       John Siracusa <siracusa () mindspring ! com>
Date:       2004-07-15 22:45:10
Message-ID: BD1C8136.1B1F1%siracusa () mindspring ! com
[Download RAW message or body]

On 7/15/04 5:40 PM, Dave Rolsky wrote:
> DateTime has a strftime() method to format existing DateTime objects but no
> coresponding strptime() method to read in formatted date strings.  You have to
> go find the DateTime::Format::Strptime module.
> 
> It would be really nice if strptime() was built into DateTime probably by
> absorbing DateTime::Format::Strptime.  This would round out the input/output
> interface nicely.

This brings back to mind (well, my mind, anyway) the earlier discussion of
adding a parse() method to DateTime, with pluggable parsers and a simple
default parser included with DateTime.

I dislike the strwhatever method names, and only tolerate them as a sop to
those who what the exact semantics of the equivalent C functions.  IMO, the
"input" method for DateTime should me more flexible than strptime().

(I also think that DateTime *should* have an "input" method, although this
view is not shared by others, IIRC.)

-John


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic