Write a C# Sharp program to get a DateTime value that represents the current date and time on the local computer
- برمجة سي شارب
- برمجة
- 2021-05-31
- ahmadghneem
الأجوبة
using System;
using System.Globalization;
public class Example5
{
public static void Main()
{
DateTime localDate = DateTime.Now;
DateTime utcDate = DateTime.UtcNow;
String[] cultureNames = { "en-IE", "en-ZA", "fr-CA",
"de-CH", "ro-RO" } ;
foreach (var cultureName in cultureNames) {
var culture = new CultureInfo(cultureName);
Console.WriteLine("{0}:", culture.NativeName);
Console.WriteLine(" Local date and time: {0}, {1:G}",
localDate.ToString(culture), localDate.Kind);
Console.WriteLine(" UTC date and time: {0}, {1:G}\n",
utcDate.ToString(culture), utcDate.Kind);
}
}
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال