[EMAIL PROTECTED] wrote:
> 
> > Flavio S. Glock <[EMAIL PROTECTED]> wrote:
> >
> >   * keys or defined_fields
> >     returns the list of names of "defined" fields
> 
> sub has {
>    # called with parameters you get true or false
>    # called with no params and you get a list of fields

I implemented this in CVS with tests, but I believe it 
should be 2 separate methods instead. What do you think?

> >   * can_be_datetime / become_datetime
> 
> sub can_be_datetime {
>    # YYYY-MM-DD
>    # YYYY-MM-DD HH:MM
>    # YYYY-MM-DD HH:MM:SS
>    # YYYY-MM-DD HH:MM:SS.NNNNNNNNN

I think any dti that has_year can become a datetime.
For example, DT::I->new( year=>2003 )->become_datetime->datetime
  2003-01-01T00:00:00
Or perhaps, allow any dti without 'holes':
 YYYY
 YYYY-MM
 YYYY-MM-DD
 YYYY-MM-DD HH
 YYYY-MM-DD HH:MM
 YYYY-MM-DD HH:MM:SS
 YYYY-MM-DD HH:MM:SS.NNNNNNNNN
this excludes, for example:
 YYYY--DD

- Flavio S. Glock

Reply via email to