<div>Hello,</div>
<div><font size="2">
<p>Has any of you ever used Python odbc to retrieve data from a relational DB? </p>
<p>I encountered a problem where it can't handle datetime <u>earlier than </u><b>1969</b>, and <u>later than </u><b>2040</b>. It just returned some garbage strings when I call str(my_date_object).</p>
<p>When I call strptime to convert the value I got ValueError exception:</p>
<p># Table records<br> for record in self._records:<br> columns = []<br> for i in range(len(self._description)):<br> if self._description[i][1]=='DATE':<br> strDate=str(record[i])<br> try:<br>
#convert the date format to be mm/dd/yyyy:<br> oDate=time.strptime(strDate) #convert to struct_time object<br> strfDate=time.strftime("%m/%d/%Y", oDate) </p>
<p>columns.append(strfDate)<br> except ValueError, msg:<br> raise "Date converstion error", msg</p>
<p>...<br> Any other solutions that you've heard?</p>
<p>Thanks very much in advance,</p></font></div>