mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-23 01:16:34 +03:00
Fixed conversion of date to Zope DateTime (closes: #145)
This commit is contained in:
parent
e59ef4de4b
commit
bee60c203a
|
@ -224,17 +224,7 @@ def _cast_DateTime(iso, curs):
|
|||
if iso in ['-infinity', 'infinity']:
|
||||
return iso
|
||||
else:
|
||||
return DateTime(re.split("GMT\+?|GMT-?|\+|-", iso)[0])
|
||||
|
||||
# this will split us into [date, time, GMT/AM/PM(if there)]
|
||||
# dt = str.split(' ')
|
||||
# if len(dt) > 1:
|
||||
# # we now should split out any timezone info
|
||||
# dt[1] = dt[1].split('-')[0]
|
||||
# dt[1] = dt[1].split('+')[0]
|
||||
# return DateTime(' '.join(dt[:2]))
|
||||
# else:
|
||||
# return DateTime(dt[0])
|
||||
return DateTime(iso)
|
||||
|
||||
# convert an ISO date string from postgres to a Zope DateTime object
|
||||
def _cast_Date(iso, curs):
|
||||
|
|
Loading…
Reference in New Issue
Block a user