(dt)
| 213 | |
| 214 | |
| 215 | def _datetime_to_json(dt): |
| 216 | # See "Date Time String Format" in the ECMA-262 specification. |
| 217 | if isinstance(dt, datetime.datetime): |
| 218 | r = dt.isoformat() |
| 219 | if dt.microsecond: |
| 220 | r = r[:23] + r[26:] |
| 221 | if r.endswith('+00:00'): |
| 222 | r = r[:-6] + 'Z' |
| 223 | return r |
| 224 | elif isinstance(dt, datetime.time): |
| 225 | r = dt.isoformat() |
| 226 | if dt.microsecond: |
| 227 | r = r[:12] |
| 228 | return r |
| 229 | else: |
| 230 | return dt.isoformat() |
| 231 | |
| 232 | |
| 233 | def jsonify(obj, |