Create a .NET Core console application Part 3 – Add code to your application

Open the program.cs file to add code to your application.

notepad .\Program.cs

Edit the code to ourput the current datetime. Then save the file.

using System;

namespace myApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
	    Console.WriteLine("The current time is " + DateTime.Now);
        }
    }
}

Time to run your application once again!

Great work! Now go and build some .NET apps!