It was not using the fields directly but taking the values of the returned 
form.vars.  I have refactored my code now and cannot see where it was an 
issue.  If I see it again I will make a proper test case. 

Dates and times drive me insane in python.  If only they would have 
flexible strtotime() function like php.

Thanks, D

On Saturday, 2 June 2012 20:20:50 UTC+1, Massimo Di Pierro wrote:
>
> I get something different. What test dod you make?
>
> >>> 
> db.define_table('x',Field('a','date'),Field('b','time'),Field('c','datetime'))
> >>> db.x.insert(a='2012-1-1',b='8:30:00',c='2012-1-1 8:30:00')
> 1
> >>> print db.x[1]
> <Row {'a': datetime.date(2012, 1, 1), 'c': datetime.datetime(2012, 1, 1, 
> 8, 30), 'b': datetime.time(8, 30), 'update_record': <function <lambda> at 
> 0x10b9fa2a8>, 'id': 1, 'delete_record': <function <lambda> at 0x10b9fa398>}>
>
> On Saturday, 2 June 2012 06:45:12 UTC-5, villas wrote:
>>
>>
>> I notice that:
>>     form.vars.date_field == str    
>>     form.vars.time_field == datetime.time
>>     form.vars.datetime_field == datetime.datetime
>>
>> Maybe it's just an anomally?  I seem to lose a lot of time getting date 
>> and time fields from one format to another.  I wonder whether there is a 
>> good resource anywhere which explains how to convert, add and subtract them 
>> etc?
>>
>

Reply via email to