title: How can I deserialize a datetime string in celery?
body: <p>I have a celery task function which takes as attribute a datetime object. Inside the celery task however this object is a string. I imagine this is serialization at work.</p>
  
  <p>How do I perform deserialization on the other end? Do I have to handle it on my own or is there a more elegant way to do it that's built in in celery?</p>
  
  <pre><code># tasks.py
  @shared_task
  def my_func(start_time, end_time):
    print(type(start_time)) # unicode, need datetime
  
  
  # calling file
  my_func.delay(datetime.now()-timedelta(hours=1), datetime.now())
  </code></pre>