Hi All,<br><br>I am pretty new to python, and I have an issue with fetching values in python using MySQLdb module. The query executed is<br><i>SELECT TIME(DATE_ADD(info_last_calltime, INTERVAL %s MINUTE)) FROM rem_call_info WHERE info_ctrlid=%s""", (retryinterval,controlid1,)</i><br>
<br>where retryinterval=30 and controlid=2, the expected output is <b>05:35:05</b>.<br><br>Now, here is code snippet, <br><br><span style="color: rgb(51, 51, 255);"> cursor1=getconnect1.cursor()</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);"> getrows=cursor1.execute("""SELECT TIME(DATE_ADD(info_last_calltime, INTERVAL %s MINUTE)) FROM rem_call_info WHERE info_ctrlid=%s""", (retryinterval,controlid1,))</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);"> rawstatus20result=cursor1.fetchone()</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> print "Raw result is",rawstatus20result</span><br style="color: rgb(51, 51, 255);">
<span style="color: rgb(51, 51, 255);"> status20result=rawstatus20result[0]</span><br style="color: rgb(51, 51, 255);"><span style="color: rgb(51, 51, 255);"> print "The query result for Status 20:",status20result,";Time now is",timeformat</span><br>
<br>The output is:<br><br><span style="color: rgb(51, 51, 255);"><span style="color: rgb(0, 153, 0);">Raw result is (datetime.timedelta(0, 20105),)</span></span><br style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 153, 0);">The query result for Status 20: <span style="color: rgb(255, 0, 0);">5:35:05</span> ;Time now is 05:22:00</span><br style="color: rgb(0, 153, 0);">
<span style="color: rgb(0, 153, 0);">Match not found.</span><br style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 153, 0);">New call to be made</span><br style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 153, 0);">Getting next value if any...</span><br>
<br>If you look closer, the time fetched by python module was 5:35:05 instead of 05:35:05. How can I get this time format? Thanks in advance.<br><br>Regards,<br><br>Kurian Thayil.<br><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup">
</div><style type="text/css">#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}</style>