Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #6815
| From | Tobiah <toby@rcsreg.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | datetime.datetime and mysql different after python2.3 |
| Date | 2011-06-01 18:42 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <is616g$h3o$1@speranza.aioe.org> (permalink) |
I'm grabbing two fields from a MySQLdb connection. One is a date type, and one is a time type. So I put the values in two variables and print them: import datetime date, time = get_fields() # for example print str(type(date)), str((type(time))) print str(date + time) In python 2.3.4, I get: <type 'DateTime'> <type 'DateTimeDelta'> 2010-07-06 09:20:45.00 Put in python2.4 and greater, I get this: <type 'datetime.date'> <type 'datetime.timedelta'> 2010-07-06 So I'm having trouble adding the two to get one datetime. Thanks for any insight. Tobiah
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
datetime.datetime and mysql different after python2.3 Tobiah <toby@rcsreg.com> - 2011-06-01 18:42 +0000 Re: datetime.datetime and mysql different after python2.3 Tobiah <toby@rcsreg.com> - 2011-06-01 18:47 +0000 Re: datetime.datetime and mysql different after python2.3 Tim Roberts <timr@probo.com> - 2011-06-01 20:41 -0700 Re: datetime.datetime and mysql different after python2.3 Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-06-03 11:05 +0200
csiph-web