input: from flask import Flask
  import datetime
  
  def create_datetime_api() -> Flask:
      """Create a simple web API using Flask to return the current date and time when accessed.
      >>> from werkzeug.test import Client
      >>> from werkzeug.wrappers import Response
      >>> app = create_datetime_api()
      >>> client = Client(app, Response)
      >>> response = client.get('/datetime')
      >>> response.status_code
      200
      >>> isinstance(response.get_data(as_text=True), str)
      True
      """
      app = Flask(__name__)
  
      @app.route('/datetime')
      def get_datetime():
          return datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
  
      return app
output:     return app