user2020,
<script>
const formatDate = (...date) => {
date = date.flat();
if(typeof date[0] === 'string') date = [Date.parse(...date)];
date = new Date(...date);
return (new Intl.DateTimeFormat("ru", {
day: "2-digit",
month: "2-digit",
year: "2-digit"
})).format(date)
}
document.write(formatDate([2020, 0, 1])+"<br>")
document.write(formatDate(2020, 0, 1)+"<br>")
document.write(formatDate('2020-10-02')+"<br>")
document.write(formatDate(1234567890000)+"<br>")
</script>