If you read up on the TEXT function, it's syntax is as follows:
=TEXT(value,format_text)
The value would be whatever value you are trying to format a specific way,
in your case, the value in cell D2.
The formatting that you want to achieve needs to be enclosed in quotes. If
you go to Help in excel, and search for help in regards to create custom
format, then create custom number format, format codes, then date and times,
you will see the choices as follows
d = day of the month with no leading zero (i.e.: 1, 2, 3...)
dd= day of the month with leading zero (i.e.: 01, 02, 03...)
ddd=day of the week in short format (Sun-Sat)
dddd= day of the week in long format (Sunday-Saturday)