Question

I have this code to retrieve the Localized Date: DateTime.Now.ToString(DateTimeFormatInfo.CurrentInfo.LongDatePattern);

The thing is that it returns the year also. I don't want the year.

So I thought I could remove the year pattern from the LongDatePattern. But there are commas in some countries and it would look bad if I removed the 2013 year.

Can someone help me to be able to do it?

Était-ce utile?

La solution

Windows.Globalization.DateTimeFormatting.DateTimeFormatter will allow you to supply a template that specifies exactly which components you want included in the formatted result ("month day dayofweek") for example.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top