Python => ValueError: unsupported format character 'Y' (0x59)

產生問題的原因是:SQL語句的'%Y-%m-%d'部分被再次解釋為字符串格式,並拋出錯誤 解決方案一:字符串%形式進行替換 '%string' % string。 '%Y-%m-%d'改寫為'%%%%Y-%%%%m-%%%%d',轉義為'%%Y-%%m-%%d' % (year, month ...

Sun Oct 01 00:41:00 CST 2017 0 1426
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM