Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top