ValueError datetime
I think the first 2 should probably work as expected with the existing DateTimeField, but the last should probably be given its own "DateField" a-la django (and maybe a TimeField as well for times).  Thanks for reporting
 Is it possible to cast them to a DateTime with 0's?  That's sorta what I'd expect to happen.  I'm coming from Ruby, and Sequel or the Ruby SQLite adapter appears to do be doing this.

I also added that the field is defined as a peewee DateTimeField().
 Totally, if the DateTimeField encounters something like example 3 it should zero out the times.
 Great!
 Thanks for fixing  :)
 Would be really good if we could pass in the format string into the field constructor. I have dates in a sqlite db of '9 January 2009' so I'd like to pass the format in:

transaction_date = DateField(format='%d %B %Y')

I'll fork and suggest something....
 Thanks for suggesting this fix, I've added it here:
 here's the commit: 0d9708a0f97685144aa7a9773755832dab459b07

the way it works is you can pass in "formats" kwarg in the field constructor containing a list of various formats to try.
 Legend Charles - you beat me to it :)

Love Peewee btw - its my ORM of choice. In fact I don't choose any
other these days - solid.

Thanks for the rapid help.

Ben

On Mon, May 14, 2012 at 5:30 PM, Charles Leifer
reply@reply.github.com
wrote:

> here's the commit: 0d9708a0f97685144aa7a9773755832dab459b07
> 
> the way it works is you can pass in "formats" kwarg in the field constructor containing a list of various formats to try.
> 
> ---
> 
> Reply to this email directly or view it on GitHub:
> https://github.com/coleifer/peewee/issues/68#issuecomment-5694864

## 

Ben Hughes
Change & Innovation Lead
Bright Approach Ltd.
Tel: +447427600266
Twitter: @bwghughes
http://about.me/bwghughes
 No problem, glad to hear you're liking peewee!

I have an SQLite database which has a DateTimeField() with a few different datetime formats (not on purpose).  I will probably fix my datetime values, but I thought I'd post this in case you feel peewee should handle this gracefully?

2011-11-15 21:53:59.759451+0000
2011-11-28 20:12:03
2009-01-01 (error)

http://paste.pocoo.org/show/aH7tITRfn9mhczxgWq3u/

Thanks for Peewee (and Flask-Peewee)!
