create new date with yyyy-mm-dd code example
Example 1: Convert a date to yyyy mm dd format
const formatYmd = date => date.toISOString().slice(0, 10);
formatYmd(new Date());
Example 2: python datetime format yyyy-mm-dd
from datetime import datetime
now = datetime.today().isoformat()
print(now) # '2018-12-05T11:15:55.126382'