Opened 19 years ago
Closed 19 years ago
#2460 closed defect (fixed)
datetime.datetime never gets processed in JSON serialization
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev |
| Severity: | normal | Keywords: | json datetime |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
This bug was originally reported by siniy (see: http://tinyurl.com/z4xov [link to userlist conversation in Google Groups])
When using JSON serialization, in function default in class DateTimeAwareJSONEncoder datetime.datetime never gets properly processed because datetime.datetime is a subclass of datetime.date and isinstance(o, datetime.date) is True even in case of o being an instance of datetime.datetime.
Note:
See TracTickets
for help on using tickets.
(In [3501]) Fixed #2460 -- JSON serializer now correctly handles datetime objects. Thanks, siniy and jyrki.pulliainen@….