Код: Выделить всё
// Set culture to English (Australia)
var culture = new CultureInfo("en-AU");
// Get the current date
var currentDate = new DateTime(2024, 6, 8);
// Display the current date using the short date pattern
var formattedDate = currentDate.ToString("d", culture);
Console.WriteLine("Short date in en-AU culture: " + formattedDate); // Outputs: 8/06/2024
// Display the abbreviated month name separately
var abbreviatedMonth = currentDate.ToString("MMM", culture);
Console.WriteLine("Abbreviated month: " + abbreviatedMonth); // Outputs: Jun
var incorrect = currentDate.ToString("dd-MMM-yy", culture);
Console.WriteLine("Incorrect format: " + incorrect); // Outputs: 08-June-24

Подробнее здесь: https://stackoverflow.com/questions/784 ... -a-slot-fo
Мобильная версия