Day of the week from date

date "+%u" --date 20210603 # returns
4

How does it know that input format is YYYYMMDD?

How does the Thermos know whether to keep things hot or cold?