I really like PHP's simple
date() format options. For example
I replicated most of this in a Typescript package, and published it on NPM.
See it here
Added in a small personal project, I added it up on Github as maybe someone else will find it useful. There are probably better solutions with more thought gone into them.
A lot of the timezone related formatting is not supported. Some functions copied from Stackoverflow (with credit url)
const date = new Date("2020-10-01"); console.log(dateFormatter('d-m-Y', date)); // 01-10-2020
For more examples, see the test file.