A
A
artemkaw2017-08-29 19:35:29
Internationalization and localization
artemkaw, 2017-08-29 19:35:29

C# - How to Russify DateTime?

Hello everyone, I am a beginner programmer and today I faced the problem of Russification of "DateTime". It was necessary to display "tomorrow of the week" on the console screen, I did it like this:

var WeekDay = System.DateTime.Now.DayOfWeek;
var WeekDay2 = WeekDay + 1;

Then output to the console:
Console.WriteLine("Завтра " + WeekDay2.ToString(CultureInfo.CreateSpecificCulture("RU-ru"));

But it gave an error: "Enum.ToString(IFormatProvider) is deprecated: The provider is not used. Please use ToString()."
I tried to change the code somehow, but it didn't work. If anyone can help, thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anvar Shakhmaev, 2017-08-29
@artemkaw

https://msdn.microsoft.com/en-us/library/5hh873ya(...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question