The standard

Report a typo

Different date formats may cause a lot of confusion, so in 1988 ISO officially introduced the standard numeric date format: YYYY-MM-DD. Let's create a function that formats dates in this way!

Below you can see a template for the function convert_to_standard. It takes a datetime object and returns the string in the standard format. You can discard hours and minutes, they are not of interest right now. Your task is to finish that function. Pay attention to the delimiters!

Note also that you do NOT need to call this function or process the input. The examples are given for clarity!

Sample Input 1:

1611-12-24 16:30

Sample Output 1:

1611-12-24
Write a program in Python 3
from datetime import datetime


def convert_to_standard(datetime_obj):
...
___

Create a free account to access the full topic