Re: cannot insert a timestamp
James Henstridge <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jun 11, 2009 at 1:00 AM, Al Niessner <[email protected]> wrote: > > I did have an extra set of quotes in there. Seems as though I wanted my > time stamps in UTC (or GMT) and the only way to do that with V1 was to > extract _o and then call gmtime() at which point I needed an extra set > of quotes around. Turns out that is a problem with V2. Now I have to > live with my timestamps being whatever zone the ticks are in. I care, > but not enough. I will just live with local timezones. > > Thanks to everyone for their help. You can use datetime objects directly with psycopg2 rather than TimestampFromTicks(). if the datetime object has a timezone attached, psycopg2 will include its offset when substituting the value into the query. Does that solve your problem? James.