Format date to convert into words

  • Thread starter Thread starter weird0
  • Start date Start date
W

weird0

I have date stored in a DateTime object. I can convert this to a
string by writing:

createdDate.ToString("dd/mm/yy")

Is there anyway, I can format the date in words along with a comma.

So, the date looks something like Dec 8, 2006.

Dont wanna go thur the hassle of writing all the code.

Regards
 
You'd think there would be an easy way to just get a time returned as 9:00
am for example.
 
You'd think there would be an easy way to just get a time returned as 9:00
am for example.


You mean like .ToString("h:mm tt")?

Of course, you could use "t" or ToShortTimeString() [etc] to get what
the user chooses as their time format

Marc
 
You'd think there would be an easy way to just get a time returned as 9:00
am for example.

Is it so hard to call dt.ToString("h:mm tt")?

If this happens to be a format you want to use frequently, stick it
into a constant. Don't forget that lots of people want subtly
different formats - and different formats are preferred in different
international contexts.

Jon
 
Hey guys, thanks for helping me stay lazy this afternoon :-) now I won't
have to slog my way through the docs.
 
createdDate.ToString("MMMM dd, yyyy")
You should go with a standard format (see Marc's answer).
That is culture-sensitive (the right thing), while using
an explicite patern will result in an American format
(even if the culture is French, and the month name,
is French, for example)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top