IS_DATETIME validator doesn't change anything. I doubt that validators are 
used by the DAL.
I guess I have to use native sql to set milliseconds?

Alex

On Wednesday, February 12, 2014 3:56:41 PM UTC+1, Manuele wrote:
>
> Il 10/02/14 12:06, Alex ha scritto: 
> > Is it possible to update a datetime column with milliseconds precision? 
> > 
> > e.g. I have a field 
> > Field('invoice_date', 'datetime') 
> > 
> > and I'm updating the field: 
> > now = datetime.datetime.now() 
> > db(db.invoice.id == 743).update(invoice_date=now) 
> > 
> > the currren time contains milliseconds: 
> > 11:58:35.696000 
> > 
> > In the executed sql statement the milliseconds are not used: 
> > UPDATE invoice SET invoice_date='2014-02-10 11:58:35' WHERE 
> > (invoice.id = 743); 
> > 
> > Is there a way to change this and also set milliseconds? 
> Have you tried using IS_DATETIME validator specifying a datetime format 
> like "%Y-%m-%d %H:%M:%S.%f" ? 
>
>
> http://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior 
>
>     M. 
> > 
> > Alex 
> > 
> > -- 
> > Resources: 
> > - http://web2py.com 
> > - http://web2py.com/book (Documentation) 
> > - http://github.com/web2py/web2py (Source code) 
> > - https://code.google.com/p/web2py/issues/list (Report Issues) 
> > --- 
> > You received this message because you are subscribed to the Google 
> > Groups "web2py-users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to [email protected] <javascript:>. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to