>> If I want to do:
>>
>>   d = datetime.now()
>>   cursor.execute("INSERT INTO mytable VALUES", somefunc(d))
>>
>> what is `somefunc()`
>>
>
> Well, I think you're looking for to_utimestamp:
>
> http://www.edgewall.org/docs/branches-1.0-stable/html/api/trac_util_datefmt.html#trac.util.datefmt.to_utimestamp

I'm seeing:

  File 
"/usr/local/lib/python2.6/dist-packages/Trac-0.11.6-py2.6.egg/trac/util/datefmt.py",
line 69, in to_utimestamp
    diff = dt - _epoc
 TypeError: can't subtract offset-naive and offset-aware datetimes

No doubt I'm passing a bad argument but the document you pointed to
doesn't indicate if the argument should be offset-naive or
offset-aware.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to trac-dev@googlegroups.com.
To unsubscribe from this group, send email to 
trac-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to