Write a C# Sharp program to display the string representation of a date and time using CultureInfo objects that represent five different cultures
- برمجة سي شارب
- برمجة
- 2021-06-01
- ahmadghneem
الأجوبة
using System;
using System.Globalization;
public class Example37
{
public static void Main()
{
CultureInfo[] cultures = new CultureInfo[] {CultureInfo.InvariantCulture,
new CultureInfo("en-ZA"),
new CultureInfo("ko-KR"),
new CultureInfo("de-DE"),
new CultureInfo("es-ES"),
new CultureInfo("en-US")};
DateTime thisDate = new DateTime(2016, 5, 17, 9, 0, 0);
foreach (CultureInfo culture in cultures)
{
string cultureName;
if (string.IsNullOrEmpty(culture.Name))
cultureName = culture.NativeName;
else
cultureName = culture.Name;
Console.WriteLine("In {0}, {1}",
cultureName, thisDate.ToString(culture));
}
}
}
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال