Posted on 2008-03-13 12:16
pts 閱讀(788)
評(píng)論(0) 編輯 收藏 所屬分類(lèi):
DataBase 、
Python
假設(shè):
有個(gè)字段mytime,類(lèi)型為日期/時(shí)間,格式為段時(shí)間
已經(jīng)輸入時(shí)間11:30
通過(guò)ADO訪(fǎng)問(wèn):
(rs,r)=conn.Execute("select mytime from table1")
1、print rs.Fields[1].Value
2、print repr(rs.Fields[1].Value)
3、print rs.Fields[1].Value.Format("%H:%M:%S %p")
輸出結(jié)果很稀奇(repr):
1、12/30/0/ 11:30:00
2、<PyTime:1899-12-30 星期六 上午 11:30:00>
3、11:30:00 AM