Answers for "date and time c#"

C#
6

c# date

using System;
class Test {
   static void Main() {
      //print current datetime
      Console.WriteLine (DateTime.Now.ToString());
      //make a custom datetime
      DateTime dt = new DateTime(2018, 7, 24);
      Console.WriteLine (dt.ToString());
   }
}
Posted by: Guest on June-06-2020
0

data time in C#

DateTime dt = new DateTime(); // assigns default value 01/01/0001 00:00:00
Posted by: Guest on June-16-2021

C# Answers by Framework

Browse Popular Code Answers by Language