Write a C# Sharp program to use these three format strings to display a date and time value by using the conventions of the en-CA and sv-FI cultures
- برمجة سي شارب
- برمجة
- 2021-06-01
- ahmadghneem
الأجوبة
using System;
using System.Globalization;
using System.Threading;
public class Example38
{
public static void Main()
{
String[] formats = { "G", "MM/yyyy", @"MM\/dd\/yyyy HH:mm",
"yyyyMMdd" };
String[] cultureNames = { "en-CA", "sv-FI" };
DateTime date = new DateTime(2016, 5, 17, 13, 31, 17);
foreach (var cultureName in cultureNames) {
var culture = new CultureInfo(cultureName);
Console.WriteLine(culture.NativeName);
foreach (var format in formats)
Console.WriteLine(" {0}: {1}", format,
date.ToString(format));
Console.WriteLine();
}
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال