input: 
  from flask import Flask
  import datetime
  
  def current_datetime_api():
      """ Create a web API with Python and Flask to give the current date and time.
      >>> app = current_datetime_api()
      >>> app.test_client().get('/datetime').data.decode()
      '2023-10-05 14:30:45'  # Example output based on current time
      """
      app = Flask(__name__)
  
      @app.route('/datetime')
      def get_datetime():
          return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
  
      return app
  
  if __name__ == '__main__':
      current_datetime_api().run()
  
output:     
      app = Flask(__name__)
  
      @app.route('/datetime')
      def get_datetime():
          return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
  
      return app
  