I need to show for the client formed by datetime, as "12 seconds", "2011"How can I get the localized string "sec", "year". Is there a special format in .net for receiving these strings?
No, but you can use something like this.
DateTime.ToString("ss") + "sec";
No no.
You will need to create resource files containing these localized values and use them.
, , :
private const string yearText = "{0} year"; // do this for month or hour or minute.. DateTime date = new DateTime(1999, 12, 10, 5, 10, 16); string year = GetYearString(date); private string GetYearString(DateTime date) { return string.Format(yearText, date.Year); }
.
Using the DateTime.ToString (String, IformatProvider) method, you can customize the DateTime view a lot (see the method documentation for more information). Some parameters are already localized using this API, but you will need a special resource file for localized versions of "sec", year ", etc.
Source: https://habr.com/ru/post/1784528/More articles:Как анализировать и индексировать различные части HTML-страницы с помощью Tika & Lucene? - searchHow to display really large text (several megabytes) in TextView? - androidUnderstanding C ++ Dynamic Distribution - c ++Updating only visible elements in JFace TreeViewer - javaHow to build a node at a given coordinate using JUNG - javaDrawing a line connecting two rectangles - java"Download" of the image freezes when moving to the next page - htmlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1784531/pass-variables-to-javascript-method-from-code-behind&usg=ALkJrhgPUqgij9DfDjHwCjfO_f78oPMBawВращение изображений справа налево с помощью CSS - cssWordPress: Related posts by tags, but in the same categories - phpAll Articles