title: TypeError: Unsupported deadline datetime.datetime(....)
body: <p>I'm trying to run a function periodically using IOLoop in Tornado. However, the following code gets the error?</p>
  <blockquote>
  <p>TypeError: Unsupported deadline datetime.datetime(2021, 11, 11, 0, 35, 49, 445200)</p>
  </blockquote>
  <pre><code>from tornado.ioloop import IOLoop
  import datetime
  
  def schedule_next_email():
      # t = datetime.date.today() + datetime.timedelta(seconds=10)
      t = datetime.datetime.now() + datetime.timedelta(seconds=10)
      # t2 = datetime.datetime.combine(t, datetime.time.min)
      def wrapper():
          print('test')
          schedule_next_email()
      IOLoop.current().add_timeout(t, wrapper)  # Error
  
  schedule_next_email() 
  </code></pre>
  <p>Ref: <a href="https://stackoverflow.com/questions/41073194/how-to-start-tornado-periodic-callback-at-a-specific-time">How to start Tornado periodic callback at a specific time?</a></p>
  <pre>
  Traceback (most recent call last):
    File "", line 1, in 
    File "", line 8, in schedule_next_email
    File "C:\Users\...\anaconda3\lib\site-packages\tornado\ioloop.py", line 585, in add_timeout
      raise TypeError("Unsupported deadline %r" % deadline)
  TypeError: Unsupported deadline datetime.datetime(2021, 11, 11, 0, 47, 28, 944375)
  </pre>