Convert Date to “dd-MMM-yyyy” format using c#

Convert Date to “dd-MMM-yyyy” format using c#

using System.IO;
using System;

class Program
{
    static void Main()
    {
        string convertedDate = DateTime.Now.ToString("dd-MMM-yyyy");
        Console.WriteLine(convertedDate);
    }
}

Result:

21-Sep-2020

2021-10-03