MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / escape_datetime

Function escape_datetime

pymysql/converters.py:122–130  ·  view source on GitHub ↗
(obj, mapping=None)

Source from the content-addressed store, hash-verified

120
121
122def escape_datetime(obj, mapping=None):
123 if obj.microsecond:
124 fmt = (
125 "'{0.year:04}-{0.month:02}-{0.day:02}"
126 + " {0.hour:02}:{0.minute:02}:{0.second:02}.{0.microsecond:06}'"
127 )
128 else:
129 fmt = "'{0.year:04}-{0.month:02}-{0.day:02} {0.hour:02}:{0.minute:02}:{0.second:02}'"
130 return fmt.format(obj)
131
132
133def escape_date(obj, mapping=None):

Callers 1

escape_struct_timeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected