-5

I am writing a text to speech program in C#, and have gotten the time information with the following code:

else if (e.KeyCode == Keys.Enter && InputTextbox.Text == "what time is it")
{
    OutputTextbox.Text = "The time is " + DateTime.Now.ToShortTimeString>();

    pBuilder.ClearContent();
    pBuilder.AppendText(OutputTextbox.Text);

    sSynth.Speak(pBuilder);

    e.SuppressKeyPress = true;
    InputTextbox.Text = "";
}

This gives me a value such as "The time is 11:01am".

Can someone please tell me a similar way to get the day of the week to return please?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
The Woo
  • 17,809
  • 26
  • 57
  • 71

1 Answers1

4

Simply:

DateTime.Now.DayOfWeek.ToString();
Simon Whitehead
  • 63,300
  • 9
  • 114
  • 138