I used to work with moment, and then moved on to date-fns. Whenever I want to format a date other than yyyy-MM-dd, I have to go see the docs. So I'm adding my most used formatting strings here.
yyyy 2021 yy 21
M 1, 2, ..., 12 Mo 1st, 2nd, ..., 12th MM 01, 02, ..., 12 MMM Jan, Feb, ..., Dec MMMM January, February, ..., December
d 1, 2, ..., 31 do 1st, 2nd, ..., 31st dd 01, 02, ..., 31
h 1, 2, ..., 11, 12 ho 1st, 2nd, ..., 11th, 12th hh 01, 02, ..., 11, 12
H 0, 1, 2, ..., 23 Ho 0th, 1st, 2nd, ..., 23rd HH 00, 01, 02, ..., 23
m 0, 1, ..., 59 mo 0th, 1st, ..., 59th mm 00, 01, ..., 59
s 0, 1, ..., 59 so 0th, 1st, ..., 59th ss 00, 01, ..., 59
a..aa AM, PM aaa am, pm aaaa a.m., p.m. aaaaa a, p b..bb AM, PM, noon, midnight bbb am, pm, noon, midnight bbbb a.m., p.m., noon, midnight bbbbb a, p, n, mi
X -08, +0530, Z XX -0800, +0530, Z XXX -08:00, +05:30, Z XXXX -0800, +0530, Z, +123456 XXXXX -08:00, +05:30, Z, +12:34:56
x -08, +0530, +00 xx -0800, +0530, +0000 xxx -08:00, +05:30, +00:00 xxxx -0800, +0530, +0000, +123456 xxxxx -08:00, +05:30, +00:00, +12:34:56
Note: Full docs are available at date-fns official docs