<html><body bgcolor="#FFFFFF"><div><span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: small; font-family: Arial; "><div><font face="Arial" size="2"><span class="180003922-17082010">Anyone know why I'm getting the following error when trying to parse the following string is there a better method to use? </span></font></div><div><font face="Arial" size="2"><span class="180003922-17082010"><br></span></font></div><div><font face="Arial" size="2"><span class="180003922-17082010">#57=<a href="tel:2010081708240065" x-apple-data-detectors="true">2010081708240065</a> - sample string passed to fmt_datetime</span></font></div><div><font face="Arial" size="2"></font> </div><div><font face="Arial" size="2">def fmt_datetime(tag57):<br> tag57 = tag57[3:len(tag57)]<br> year = int ( tag57[0:4] )<br> mon = int ( tag57[4:6] )<br> day = int ( tag57[6:8])<br> hour = int ( tag57[<a href="x-apple-data-detectors://1" x-apple-data-detectors="true">8:10</a>] )<br> min = int ( tag57[<a href="x-apple-data-detectors://2" x-apple-data-detectors="true">10:12</a>] )<br> sec = int ( tag57[<a href="x-apple-data-detectors://3" x-apple-data-detectors="true">12:14</a>] )<br> msec = int ( tag57[<a href="x-apple-data-detectors://4" x-apple-data-detectors="true">14:16</a>] )</font></div><div><font face="Arial" size="2"><br> dt = datetime.datetime(year,mon,day,hour,min,sec)<br> return '{:%Y-%m-%d %H:%M:%S}'.format(dt)<br></font></div><div><font face="Arial" size="2"><br></font></div><div><font face="Arial" size="2"> File "./delta_delay.py", line 27, in fmt_datetime<br> return '{:%Y-%m-%d %H:%M:%S}'.format(dt)<br>ValueError: zero length field name in format<br></font></div><font face="Arial" size="2"></font><div> </div></span><br><br></div><div></div></body></html>