/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System.Globalization/DateTimeFormatInfo/csharp/example3.cs
25 строк
852 B
Genevieve Warren
Extract remarks for System.Globalization* (#38912)
29 дек 2023, 20:03
Не верифицирован
29 дек 2023, 20:03
7f945f9
Код
Авторство
О чём код?
// <Snippet12> using System; using System.Globalization; public class Example3 { public static void Main() { DateTime dateValue = new DateTime(2013, 08, 28); CultureInfo frFR = CultureInfo.CreateSpecificCulture("fr-FR"); DateTimeFormatInfo dtfi = frFR.DateTimeFormat; Console.WriteLine("Before modifying DateSeparator property: {0}", dateValue.ToString("g", frFR)); // Modify the date separator. dtfi.DateSeparator = "-"; Console.WriteLine("After modifying the DateSeparator property: {0}", dateValue.ToString("g", frFR)); } } // The example displays the following output: // Before modifying DateSeparator property: 28/08/2013 00:00 // After modifying the DateSeparator property: 28-08-2013 00:00 // </Snippet12>