The Clock

Report a typo

Write a program that returns a Response object when accessing the main page ( / ). The message should show the current date in YYYY.MM.DD format and the response code 200.

Tip: You can get the time with the datetime module, see the code below

Write a program in Python 3
from flask import Flask, make_response
import datetime

app = Flask('main')

@app.route('code_here')
def main_view():
time = datetime.datetime.now()
year, month, day = time.year, time.month, time.day

# your code here
___

Create a free account to access the full topic