title: Bottle framework: how to return datetime in JSON response
body: <p>When I try to return JSON containing <code>datetime</code> value, I'm getting</p>
  
  <pre><code>  File "/usr/lib/python2.7/json/encoder.py", line 178, in default
      raise TypeError(repr(o) + " is not JSON serializable")
  TypeError: datetime.datetime(2014, 2, 1, 0, 0) is not JSON serializable
  </code></pre>
  
  <p>Which is normal. Is there an easy way to add an object hook to <code>bottle</code> like</p>
  
  <pre><code>from bson import json_util
  import json
  json.dumps(anObject, default=json_util.default)
  </code></pre>
  
  <p>to get <code>datetime</code> values converted?</p>