Django

Code

Ticket #2460 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

datetime.datetime never gets processed in JSON serialization

Reported by: jyrki.pulliainen@gmail.com Assigned to: adrian
Milestone: Component: Core framework
Version: SVN Keywords: json datetime
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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.

Attachments

Change History

07/31/06 09:59:54 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

(In [3501]) Fixed #2460 -- JSON serializer now correctly handles datetime objects. Thanks, siniy and jyrki.pulliainen@gmail.com.


Add/Change #2460 (datetime.datetime never gets processed in JSON serialization)




Change Properties
Action