DateTime.DayOfWeek localisation

  • Thread starter Thread starter Gerben van Loon
  • Start date Start date
G

Gerben van Loon

Hi there, hope someone can help me on this:

DateTime.Now.DayOfWeek is always returning the american day names like
"Monday, Saturday". Even when my CurrentCulture is set to my localized
culture. I like to have my localized daynames returned. How can I do this?

greets,

Gerben.
 
Write your own class which can read the culture and translate the DayofWeek
according what you have read.

Hope this will help
 
That is a property that returns an enum - you cannot localize the items in
an enum. You should be using the DayNames property of the
System.Globalization.DateTimeFormatInfo, which is localized based on the
current culture.
 
Thank you Andrew, works great.

Andrew (Infragistics) said:
That is a property that returns an enum - you cannot localize the items in
an enum. You should be using the DayNames property of the
System.Globalization.DateTimeFormatInfo, which is localized based on the
current culture.
 
Back
Top