-2

How can I convert a DateTime to a String?

For instance, I want to convert a DateTime representing:

11/30/2012 

to

November Thirtieth Two Thousand Twelve
Nate
  • 30,286
  • 23
  • 113
  • 184
Juan Carlos
  • 171
  • 1
  • 6

2 Answers2

4

Your google-fu is weak my friend, but you will learn: http://www.c-sharpcorner.com/UploadFile/b942f9/converting-dates-to-words-in-C-Sharp/ :)

povilasp
  • 2,386
  • 1
  • 22
  • 36
0

No luck here, but a partial relief:

String.Format("{0:dddd, MMMM d, yyyy}", dt); // "Sunday, March 9, 2008" Source

The Day and Year string you will have to do the long way. Day-of-Week and Month are available.

Ray K
  • 1,452
  • 10
  • 17