Hello Christopher,

On 9/18/2012 2:21 PM, Christopher Nelson wrote:
> http://trac.edgewall.org/wiki/TracDev/DatabaseApi#GuidelinesforSQLStatements
> says "store date and time information in seconds as int fields (before
> 0.12) or better, in microseconds and bigint fields (since 0.12)" but
> I've looked at Python language and library documentation and Goggled
> around some and not found a clear way to convert from the Python
> datetime object in my code to the bigint I want to put in the db.
> Team Calendar breaks that rule and I'm scratching my head to find
> another date-aware plugin to spelunk the source of.
> 
> 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

-- Christian

-- 
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