The set dateformat command specifies the order of the date parts (month, day, and year) when dates are entered as strings of numbers with separators.
set language can also affect the format for dates, depending on the default date format for the language you specify. The default language is us_english, and the default date format is mdy. See the Reference Manual: Commands.