Step 1. Open Visual Studio.
Step 2. Click Console Application and click OK button.
Step 3. Type the program to see the current date and time in the program list.
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Time {
- class Program {
- static void Main(string[] args) {
- Console.Write("Current Date and Time is : ");
- DateTime now = DateTime.Now;
- Console.WriteLine(now);
- Console.ReadLine();
- }
- }
- }
Step 4. From the code, the output is given below-