On 2008-07-18 05:28, Dennis Lee Bieber wrote:
On Thu, 17 Jul 2008 20:26:11 -0300, Gabriel Genellina
[EMAIL PROTECTED] declaimed the following in comp.lang.python:
Note that I used %s everywhere (it's just a placeholder, not a format) and
cue the beer commercial
On 2008-07-16 20:00, Keith Hughitt wrote:
Thanks Gabriel!
That helps clear things up for me. The above method works very well. I
only have one remaining question:
How can I pass a datetime object to MySQL?'
So far, what I've been doing is building the query as a string, for
example:
query =
On 2008-07-17 22:43, Dennis Lee Bieber wrote:
On Thu, 17 Jul 2008 19:55:44 +0200, M.-A. Lemburg [EMAIL PROTECTED]
declaimed the following in comp.lang.python:
Use binding parameters and it should work:
query = INSERT INTO image VALUES(%d, %d, %s, '%s')
If this is MySQLdb interface:
En Wed, 16 Jul 2008 15:00:50 -0300, Keith Hughitt
[EMAIL PROTECTED] escribi�:
Thanks Gabriel!
That helps clear things up for me. The above method works very well. I
only have one remaining question:
How can I pass a datetime object to MySQL?'
So far, what I've been doing is building the
In message [EMAIL PROTECTED], Gabriel
Genellina wrote:
Note that I used %s everywhere (it's just a placeholder, not a format) ...
From /usr/lib64/python2.5/site-packages/MySQLdb/cursors.py, lines 150-151:
if args is not None:
query = query % db.literal(args)
--
Thanks Gabriel!
That helps clear things up for me. The above method works very well. I
only have one remaining question:
How can I pass a datetime object to MySQL?'
So far, what I've been doing is building the query as a string, for
example:
query = INSERT INTO image VALUES(%d, %d, %s, '%s') %
In message
[EMAIL PROTECTED], Keith
Hughitt wrote:
I have a UTC date (e.g. 2008-07-11 00:00:00). I would like to create a
UTC date ...
import calendar
calendar.timegm((2008, 7, 11, 0, 0, 0, 0, 0, -1))
1215734400
[EMAIL PROTECTED] TZ=NZ date -d 00:00:00 01-Jan-1970Z +1215734400 seconds
Fri
Gabriel Genellina [EMAIL PROTECTED]:
En Fri, 11 Jul 2008 15:42:37 -0300, Keith Hughitt
[EMAIL PROTECTED] escribi�:
I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when
Hi,
I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all dates at local dates by default), it will already have
incorporated the proper
En Fri, 11 Jul 2008 15:42:37 -0300, Keith Hughitt
[EMAIL PROTECTED] escribi�:
I am having a little trouble figuring out how to convert a python
datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I would
like to create a UTC date so that when I send it to MySQL (which
treats all
10 matches
Mail list logo