title: Passing datetime to json using python
body: <p>i am new to python programming 
  i have a dictionary object like</p>
  
  <pre><code>data={
      'joiningdate': datetime.datetime(2016, 10, 13, 0, 0),
      'shift': datetime.time(8, 0)
  }
  </code></pre>
  
  <p>i want to pass this value to json 
  what i am done is</p>
  
  <pre><code>class MyEncoder1(json.JSONEncoder):
     def default(self, obj):
         if isinstance(obj,datetime.date):
             obj= datetime.datetime.strptime(obj,"%Y-%m-%d ")
         elif isinstance(obj, datetime.datetime):
             obj= datetime.datetime.strptime(obj,"%Y-%m-%d %H:%M:%S.%f")
         elif isinstance(obj, datetime.time):
             obj = datetime.time.strftime(obj,"%H:%M:%S")
         elif isinstance(obj, Decimal):
             obj = float(obj)
         else:
             obj = super(MyEncoder1, self).default(obj)
         return obj
     json_array = dumps(data,cls=MyEncoder1)
  </code></pre>
  
  <p>it is printing time only like 00:08:00
  but date is not printing 
  can any one please help</p>